home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1988-08-01 | 38.9 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
You can browse this item here: TESample.p
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| ZX81 Sinclair BASIC (image/sinclairBASIC)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| bsdiff patch (other/bsdiffPatch)
| ext
| Unsupported |
1%
| dexvert
| imgdiff patch (other/imgdiffPatch)
| ext
| Unsupported |
1%
| dexvert
| WSUS Patch Storage File (other/wsusPatchStorageFile)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Mon Aug 1 18:08:07 1988, modified Mon Aug 1 18:08:07 1988, creator 'MPS ', type ASCII, 38346 bytes "TESample.p" , at 0x964a 1228 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 54 45 53 61 6d 70 | 6c 65 2e 70 00 00 00 00 |..TESamp|le.p....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 95 ca 00 | 00 04 cc 9f 1a 9c 47 9f |........|......G.|
|00000060| 1a 9c 47 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..G.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 01 06 00 00 |........|........|
|00000080| 7b 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |{-------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |--------|-------.|
|000000d0| 23 0d 23 09 41 70 70 6c | 65 20 4d 61 63 69 6e 74 |#.#.Appl|e Macint|
|000000e0| 6f 73 68 20 44 65 76 65 | 6c 6f 70 65 72 20 54 65 |osh Deve|loper Te|
|000000f0| 63 68 6e 69 63 61 6c 20 | 53 75 70 70 6f 72 74 0d |chnical |Support.|
|00000100| 23 0d 23 09 4d 75 6c 74 | 69 46 69 6e 64 65 72 2d |#.#.Mult|iFinder-|
|00000110| 41 77 61 72 65 20 53 69 | 6d 70 6c 65 20 54 65 78 |Aware Si|mple Tex|
|00000120| 74 45 64 69 74 20 53 61 | 6d 70 6c 65 20 41 70 70 |tEdit Sa|mple App|
|00000130| 6c 69 63 61 74 69 6f 6e | 0d 23 0d 23 09 54 45 53 |lication|.#.#.TES|
|00000140| 61 6d 70 6c 65 0d 23 0d | 23 09 54 45 53 61 6d 70 |ample.#.|#.TESamp|
|00000150| 6c 65 2e 70 09 2d 09 50 | 61 73 63 61 6c 20 53 6f |le.p.-.P|ascal So|
|00000160| 75 72 63 65 0d 23 0d 23 | 09 43 6f 70 79 72 69 67 |urce.#.#|.Copyrig|
|00000170| 68 74 20 a9 20 31 39 38 | 38 20 41 70 70 6c 65 20 |ht . 198|8 Apple |
|00000180| 43 6f 6d 70 75 74 65 72 | 2c 20 49 6e 63 2e 0d 23 |Computer|, Inc..#|
|00000190| 09 41 6c 6c 20 72 69 67 | 68 74 73 20 72 65 73 65 |.All rig|hts rese|
|000001a0| 72 76 65 64 2e 0d 23 0d | 23 09 56 65 72 73 69 6f |rved..#.|#.Versio|
|000001b0| 6e 73 3a 09 31 2e 30 09 | 09 09 09 09 38 2f 38 38 |ns:.1.0.|....8/88|
|000001c0| 0d 23 0d 23 09 43 6f 6d | 70 6f 6e 65 6e 74 73 3a |.#.#.Com|ponents:|
|000001d0| 09 54 45 53 61 6d 70 6c | 65 2e 70 09 09 09 41 75 |.TESampl|e.p...Au|
|000001e0| 67 75 73 74 20 31 2c 20 | 31 39 38 38 0d 23 09 09 |gust 1, |1988.#..|
|000001f0| 09 09 54 45 53 61 6d 70 | 6c 65 2e 63 09 09 09 41 |..TESamp|le.c...A|
|00000200| 75 67 75 73 74 20 31 2c | 20 31 39 38 38 0d 23 09 |ugust 1,| 1988.#.|
|00000210| 09 09 09 54 45 53 61 6d | 70 6c 65 2e 61 09 09 09 |...TESam|ple.a...|
|00000220| 41 75 67 75 73 74 20 31 | 2c 20 31 39 38 38 0d 23 |August 1|, 1988.#|
|00000230| 09 09 09 09 54 45 53 61 | 6d 70 6c 65 2e 72 09 09 |....TESa|mple.r..|
|00000240| 09 41 75 67 75 73 74 20 | 31 2c 20 31 39 38 38 0d |.August |1, 1988.|
|00000250| 23 09 09 09 09 54 45 53 | 61 6d 70 6c 65 2e 68 09 |#....TES|ample.h.|
|00000260| 09 09 41 75 67 75 73 74 | 20 31 2c 20 31 39 38 38 |..August| 1, 1988|
|00000270| 0d 23 09 09 09 09 50 54 | 45 53 61 6d 70 6c 65 2e |.#....PT|ESample.|
|00000280| 6d 61 6b 65 09 09 41 75 | 67 75 73 74 20 31 2c 20 |make..Au|gust 1, |
|00000290| 31 39 38 38 0d 23 09 09 | 09 09 43 54 45 53 61 6d |1988.#..|..CTESam|
|000002a0| 70 6c 65 2e 6d 61 6b 65 | 09 09 41 75 67 75 73 74 |ple.make|..August|
|000002b0| 20 31 2c 20 31 39 38 38 | 0d 23 0d 23 09 54 45 53 | 1, 1988|.#.#.TES|
|000002c0| 61 6d 70 6c 65 20 69 73 | 20 61 6e 20 65 78 61 6d |ample is| an exam|
|000002d0| 70 6c 65 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |ple appl|ication |
|000002e0| 74 68 61 74 20 64 65 6d | 6f 6e 73 74 72 61 74 65 |that dem|onstrate|
|000002f0| 73 20 68 6f 77 20 0d 23 | 09 74 6f 20 69 6e 69 74 |s how .#|.to init|
|00000300| 69 61 6c 69 7a 65 20 74 | 68 65 20 63 6f 6d 6d 6f |ialize t|he commo|
|00000310| 6e 6c 79 20 75 73 65 64 | 20 74 6f 6f 6c 62 6f 78 |nly used| toolbox|
|00000320| 20 6d 61 6e 61 67 65 72 | 73 2c 20 6f 70 65 72 61 | manager|s, opera|
|00000330| 74 65 20 0d 23 09 73 75 | 63 63 65 73 73 66 75 6c |te .#.su|ccessful|
|00000340| 6c 79 20 75 6e 64 65 72 | 20 4d 75 6c 74 69 46 69 |ly under| MultiFi|
|00000350| 6e 64 65 72 2c 20 68 61 | 6e 64 6c 65 20 64 65 73 |nder, ha|ndle des|
|00000360| 6b 20 61 63 63 65 73 73 | 6f 72 69 65 73 20 61 6e |k access|ories an|
|00000370| 64 20 0d 23 09 63 72 65 | 61 74 65 2c 20 67 72 6f |d .#.cre|ate, gro|
|00000380| 77 2c 20 61 6e 64 20 7a | 6f 6f 6d 20 77 69 6e 64 |w, and z|oom wind|
|00000390| 6f 77 73 2e 20 54 68 65 | 20 66 75 6e 64 61 6d 65 |ows. The| fundame|
|000003a0| 6e 74 61 6c 20 54 65 78 | 74 45 64 69 74 20 0d 23 |ntal Tex|tEdit .#|
|000003b0| 09 74 6f 6f 6c 62 6f 78 | 20 63 61 6c 6c 73 20 61 |.toolbox| calls a|
|000003c0| 6e 64 20 54 65 78 74 45 | 64 69 74 20 61 75 74 6f |nd TextE|dit auto|
|000003d0| 73 63 72 6f 6c 6c 20 61 | 72 65 20 64 65 6d 6f 6e |scroll a|re demon|
|000003e0| 73 74 72 61 74 65 64 2e | 20 49 74 20 0d 23 09 61 |strated.| It .#.a|
|000003f0| 6c 73 6f 20 73 68 6f 77 | 73 20 68 6f 77 20 74 6f |lso show|s how to|
|00000400| 20 63 72 65 61 74 65 20 | 61 6e 64 20 6d 61 69 6e | create |and main|
|00000410| 74 61 69 6e 20 73 63 72 | 6f 6c 6c 62 61 72 20 63 |tain scr|ollbar c|
|00000420| 6f 6e 74 72 6f 6c 73 2e | 0d 23 0d 23 09 49 74 20 |ontrols.|.#.#.It |
|00000430| 64 6f 65 73 20 6e 6f 74 | 20 62 79 20 61 6e 79 20 |does not| by any |
|00000440| 6d 65 61 6e 73 20 64 65 | 6d 6f 6e 73 74 72 61 74 |means de|monstrat|
|00000450| 65 20 61 6c 6c 20 74 68 | 65 20 74 65 63 68 6e 69 |e all th|e techni|
|00000460| 71 75 65 73 20 79 6f 75 | 20 0d 23 09 6e 65 65 64 |ques you| .#.need|
|00000470| 20 66 6f 72 20 61 20 6c | 61 72 67 65 20 61 70 70 | for a l|arge app|
|00000480| 6c 69 63 61 74 69 6f 6e | 2e 20 49 6e 20 70 61 72 |lication|. In par|
|00000490| 74 69 63 75 6c 61 72 2c | 20 53 61 6d 70 6c 65 20 |ticular,| Sample |
|000004a0| 64 6f 65 73 20 6e 6f 74 | 20 0d 23 09 63 6f 76 65 |does not| .#.cove|
|000004b0| 72 20 65 78 63 65 70 74 | 69 6f 6e 20 68 61 6e 64 |r except|ion hand|
|000004c0| 6c 69 6e 67 2c 20 6d 75 | 6c 74 69 70 6c 65 20 77 |ling, mu|ltiple w|
|000004d0| 69 6e 64 6f 77 73 2f 64 | 6f 63 75 6d 65 6e 74 73 |indows/d|ocuments|
|000004e0| 2c 20 0d 23 09 73 6f 70 | 68 69 73 74 69 63 61 74 |, .#.sop|histicat|
|000004f0| 65 64 20 6d 65 6d 6f 72 | 79 20 6d 61 6e 61 67 65 |ed memor|y manage|
|00000500| 6d 65 6e 74 2c 20 70 72 | 69 6e 74 69 6e 67 2c 20 |ment, pr|inting, |
|00000510| 6f 72 20 75 6e 64 6f 2e | 20 41 6c 6c 20 6f 66 20 |or undo.| All of |
|00000520| 0d 23 09 74 68 65 73 65 | 20 61 72 65 20 76 69 74 |.#.these| are vit|
|00000530| 61 6c 20 70 61 72 74 73 | 20 6f 66 20 61 20 6e 6f |al parts| of a no|
|00000540| 72 6d 61 6c 20 66 75 6c | 6c 2d 73 69 7a 65 64 20 |rmal ful|l-sized |
|00000550| 61 70 70 6c 69 63 61 74 | 69 6f 6e 2e 0d 23 0d 23 |applicat|ion..#.#|
|00000560| 09 54 68 69 73 20 61 70 | 70 6c 69 63 61 74 69 6f |.This ap|plicatio|
|00000570| 6e 20 69 73 20 61 6e 20 | 65 78 61 6d 70 6c 65 20 |n is an |example |
|00000580| 6f 66 20 74 68 65 20 66 | 6f 72 6d 20 6f 66 20 61 |of the f|orm of a|
|00000590| 20 4d 61 63 69 6e 74 6f | 73 68 20 0d 23 09 61 70 | Macinto|sh .#.ap|
|000005a0| 70 6c 69 63 61 74 69 6f | 6e 3b 20 69 74 20 69 73 |plicatio|n; it is|
|000005b0| 20 4e 4f 54 20 61 20 74 | 65 6d 70 6c 61 74 65 2e | NOT a t|emplate.|
|000005c0| 20 49 74 20 69 73 20 4e | 4f 54 20 69 6e 74 65 6e | It is N|OT inten|
|000005d0| 64 65 64 20 74 6f 20 62 | 65 20 0d 23 09 75 73 65 |ded to b|e .#.use|
|000005e0| 64 20 61 73 20 61 20 66 | 6f 75 6e 64 61 74 69 6f |d as a f|oundatio|
|000005f0| 6e 20 66 6f 72 20 74 68 | 65 20 6e 65 78 74 20 77 |n for th|e next w|
|00000600| 6f 72 6c 64 2d 63 6c 61 | 73 73 2c 20 62 65 73 74 |orld-cla|ss, best|
|00000610| 2d 73 65 6c 6c 69 6e 67 | 2c 20 0d 23 09 36 30 30 |-selling|, .#.600|
|00000620| 4b 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 2e 20 41 |K applic|ation. A|
|00000630| 20 73 74 69 63 6b 20 66 | 69 67 75 72 65 20 64 72 | stick f|igure dr|
|00000640| 61 77 69 6e 67 20 6f 66 | 20 74 68 65 20 68 75 6d |awing of| the hum|
|00000650| 61 6e 20 62 6f 64 79 20 | 6d 61 79 20 0d 23 09 62 |an body |may .#.b|
|00000660| 65 20 61 20 67 6f 6f 64 | 20 65 78 61 6d 70 6c 65 |e a good| example|
|00000670| 20 6f 66 20 74 68 65 20 | 66 6f 72 6d 20 66 6f 72 | of the |form for|
|00000680| 20 61 20 70 61 69 6e 74 | 69 6e 67 2c 20 62 75 74 | a paint|ing, but|
|00000690| 20 74 68 61 74 20 64 6f | 65 73 20 6e 6f 74 20 0d | that do|es not .|
|000006a0| 23 09 6d 65 61 6e 20 69 | 74 20 73 68 6f 75 6c 64 |#.mean i|t should|
|000006b0| 20 62 65 20 75 73 65 64 | 20 61 73 20 74 68 65 20 | be used| as the |
|000006c0| 62 61 73 69 73 20 66 6f | 72 20 74 68 65 20 6e 65 |basis fo|r the ne|
|000006d0| 78 74 20 4d 6f 6e 61 20 | 4c 69 73 61 2e 0d 23 0d |xt Mona |Lisa..#.|
|000006e0| 23 09 57 65 20 72 65 63 | 6f 6d 6d 65 6e 64 20 74 |#.We rec|ommend t|
|000006f0| 68 61 74 20 79 6f 75 20 | 72 65 76 69 65 77 20 74 |hat you |review t|
|00000700| 68 69 73 20 70 72 6f 67 | 72 61 6d 20 6f 72 20 53 |his prog|ram or S|
|00000710| 61 6d 70 6c 65 20 62 65 | 66 6f 72 65 20 0d 23 09 |ample be|fore .#.|
|00000720| 62 65 67 69 6e 6e 69 6e | 67 20 61 20 6e 65 77 20 |beginnin|g a new |
|00000730| 61 70 70 6c 69 63 61 74 | 69 6f 6e 2e 20 53 61 6d |applicat|ion. Sam|
|00000740| 70 6c 65 20 69 73 20 61 | 20 73 69 6d 70 6c 65 20 |ple is a| simple |
|00000750| 61 70 70 2e 20 77 68 69 | 63 68 20 64 6f 65 73 6e |app. whi|ch doesn|
|00000760| d5 74 20 0d 23 09 75 73 | 65 20 54 65 78 74 45 64 |.t .#.us|e TextEd|
|00000770| 69 74 20 6f 72 20 74 68 | 65 20 43 6f 6e 74 72 6f |it or th|e Contro|
|00000780| 6c 20 4d 61 6e 61 67 65 | 72 2e 0d 23 0d 2d 2d 2d |l Manage|r..#.---|
|00000790| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000007a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000007b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000007c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000007d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 7d 0d 0d 0d 50 |--------|---}...P|
|000007e0| 52 4f 47 52 41 4d 20 54 | 45 53 61 6d 70 6c 65 3b |ROGRAM T|ESample;|
|000007f0| 0d 0d 0d 7b 53 65 67 6d | 65 6e 74 61 74 69 6f 6e |...{Segm|entation|
|00000800| 20 73 74 72 61 74 65 67 | 79 3a 0d 0d 20 54 68 69 | strateg|y:.. Thi|
|00000810| 73 20 70 72 6f 67 72 61 | 6d 20 63 6f 6e 73 69 73 |s progra|m consis|
|00000820| 74 73 20 6f 66 20 74 68 | 72 65 65 20 73 65 67 6d |ts of th|ree segm|
|00000830| 65 6e 74 73 2e 20 4d 61 | 69 6e 20 63 6f 6e 74 61 |ents. Ma|in conta|
|00000840| 69 6e 73 20 6d 6f 73 74 | 20 6f 66 20 74 68 65 20 |ins most| of the |
|00000850| 63 6f 64 65 2c 0d 20 69 | 6e 63 6c 75 64 69 6e 67 |code,. i|ncluding|
|00000860| 20 74 68 65 20 4d 50 57 | 20 6c 69 62 72 61 72 69 | the MPW| librari|
|00000870| 65 73 2c 20 61 6e 64 20 | 74 68 65 20 6d 61 69 6e |es, and |the main|
|00000880| 20 70 72 6f 67 72 61 6d | 2e 20 49 6e 69 74 69 61 | program|. Initia|
|00000890| 6c 69 7a 65 20 63 6f 6e | 74 61 69 6e 73 0d 20 63 |lize con|tains. c|
|000008a0| 6f 64 65 20 74 68 61 74 | 20 69 73 20 6f 6e 6c 79 |ode that| is only|
|000008b0| 20 75 73 65 64 20 6f 6e | 63 65 2c 20 64 75 72 69 | used on|ce, duri|
|000008c0| 6e 67 20 73 74 61 72 74 | 75 70 2c 20 61 6e 64 20 |ng start|up, and |
|000008d0| 63 61 6e 20 62 65 20 75 | 6e 6c 6f 61 64 65 64 20 |can be u|nloaded |
|000008e0| 61 66 74 65 72 20 74 68 | 65 0d 20 70 72 6f 67 72 |after th|e. progr|
|000008f0| 61 6d 20 73 74 61 72 74 | 73 2e 20 25 41 35 49 6e |am start|s. %A5In|
|00000900| 69 74 20 69 73 20 61 75 | 74 6f 6d 61 74 69 63 61 |it is au|tomatica|
|00000910| 6c 6c 79 20 63 72 65 61 | 74 65 64 20 62 79 20 74 |lly crea|ted by t|
|00000920| 68 65 20 4c 69 6e 6b 65 | 72 20 74 6f 20 69 6e 69 |he Linke|r to ini|
|00000930| 74 69 61 6c 69 7a 65 0d | 20 67 6c 6f 62 61 6c 73 |tialize.| globals|
|00000940| 20 66 6f 72 20 74 68 65 | 20 4d 50 57 20 6c 69 62 | for the| MPW lib|
|00000950| 72 61 72 69 65 73 20 61 | 6e 64 20 69 73 20 75 6e |raries a|nd is un|
|00000960| 6c 6f 61 64 65 64 20 72 | 69 67 68 74 20 61 77 61 |loaded r|ight awa|
|00000970| 79 2e 7d 0d 0d 0d 7b 53 | 65 74 50 6f 72 74 20 73 |y.}...{S|etPort s|
|00000980| 74 72 61 74 65 67 79 3a | 0d 0d 20 54 6f 6f 6c 62 |trategy:|.. Toolb|
|00000990| 6f 78 20 72 6f 75 74 69 | 6e 65 73 20 64 6f 20 6e |ox routi|nes do n|
|000009a0| 6f 74 20 63 68 61 6e 67 | 65 20 74 68 65 20 63 75 |ot chang|e the cu|
|000009b0| 72 72 65 6e 74 20 70 6f | 72 74 2e 20 49 6e 20 73 |rrent po|rt. In s|
|000009c0| 70 69 74 65 20 6f 66 20 | 74 68 69 73 2c 20 69 6e |pite of |this, in|
|000009d0| 20 74 68 69 73 0d 20 70 | 72 6f 67 72 61 6d 20 77 | this. p|rogram w|
|000009e0| 65 20 75 73 65 20 61 20 | 73 74 72 61 74 65 67 79 |e use a |strategy|
|000009f0| 20 6f 66 20 63 61 6c 6c | 69 6e 67 20 53 65 74 50 | of call|ing SetP|
|00000a00| 6f 72 74 20 77 68 65 6e | 65 76 65 72 20 77 65 20 |ort when|ever we |
|00000a10| 77 61 6e 74 20 74 6f 20 | 64 72 61 77 20 6f 72 0d |want to |draw or.|
|00000a20| 20 6d 61 6b 65 20 63 61 | 6c 6c 73 20 77 68 69 63 | make ca|lls whic|
|00000a30| 68 20 64 65 70 65 6e 64 | 20 6f 6e 20 74 68 65 20 |h depend| on the |
|00000a40| 63 75 72 72 65 6e 74 20 | 70 6f 72 74 2e 20 54 68 |current |port. Th|
|00000a50| 69 73 20 6d 61 6b 65 73 | 20 75 73 20 6c 65 73 73 |is makes| us less|
|00000a60| 20 76 75 6c 6e 65 72 61 | 62 6c 65 0d 20 74 6f 20 | vulnera|ble. to |
|00000a70| 62 75 67 73 20 69 6e 20 | 6f 74 68 65 72 20 73 6f |bugs in |other so|
|00000a80| 66 74 77 61 72 65 20 77 | 68 69 63 68 20 6d 69 67 |ftware w|hich mig|
|00000a90| 68 74 20 61 6c 74 65 72 | 20 74 68 65 20 63 75 72 |ht alter| the cur|
|00000aa0| 72 65 6e 74 20 70 6f 72 | 74 20 28 73 75 63 68 20 |rent por|t (such |
|00000ab0| 61 73 20 74 68 65 0d 20 | 62 75 67 20 28 66 65 61 |as the. |bug (fea|
|00000ac0| 74 75 72 65 3f 29 20 69 | 6e 20 6d 61 6e 79 20 64 |ture?) i|n many d|
|00000ad0| 65 73 6b 20 61 63 63 65 | 73 73 6f 72 69 65 73 20 |esk acce|ssories |
|00000ae0| 77 68 69 63 68 20 63 68 | 61 6e 67 65 20 74 68 65 |which ch|ange the|
|00000af0| 20 70 6f 72 74 20 6f 6e | 20 4f 70 65 6e 44 65 73 | port on| OpenDes|
|00000b00| 6b 41 63 63 29 2e 0d 20 | 48 6f 70 65 66 75 6c 6c |kAcc).. |Hopefull|
|00000b10| 79 2c 20 74 68 69 73 20 | 61 6c 73 6f 20 6d 61 6b |y, this |also mak|
|00000b20| 65 73 20 74 68 65 20 72 | 6f 75 74 69 6e 65 73 20 |es the r|outines |
|00000b30| 66 72 6f 6d 20 74 68 69 | 73 20 70 72 6f 67 72 61 |from thi|s progra|
|00000b40| 6d 20 6d 6f 72 65 20 73 | 65 6c 66 2d 63 6f 6e 74 |m more s|elf-cont|
|00000b50| 61 69 6e 65 64 2c 0d 20 | 73 69 6e 63 65 20 74 68 |ained,. |since th|
|00000b60| 65 79 20 64 6f 6e 27 74 | 20 64 65 70 65 6e 64 20 |ey don't| depend |
|00000b70| 6f 6e 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 70 |on the c|urrent p|
|00000b80| 6f 72 74 20 73 65 74 74 | 69 6e 67 2e 7d 0d 0d 0d |ort sett|ing.}...|
|00000b90| 7b 43 6c 69 70 62 6f 61 | 72 64 20 73 74 72 61 74 |{Clipboa|rd strat|
|00000ba0| 65 67 79 3a 0d 0d 20 54 | 68 69 73 20 70 72 6f 67 |egy:.. T|his prog|
|00000bb0| 72 61 6d 20 64 6f 65 73 | 20 6e 6f 74 20 6d 61 69 |ram does| not mai|
|00000bc0| 6e 74 61 69 6e 20 61 20 | 70 72 69 76 61 74 65 20 |ntain a |private |
|00000bd0| 73 63 72 61 70 2e 20 57 | 68 65 6e 65 76 65 72 20 |scrap. W|henever |
|00000be0| 61 20 63 75 74 2c 20 63 | 6f 70 79 2c 20 6f 72 20 |a cut, c|opy, or |
|00000bf0| 70 61 73 74 65 0d 20 6f | 63 63 75 72 73 2c 20 77 |paste. o|ccurs, w|
|00000c00| 65 20 69 6d 70 6f 72 74 | 2f 65 78 70 6f 72 74 20 |e import|/export |
|00000c10| 66 72 6f 6d 20 74 68 65 | 20 70 75 62 6c 69 63 20 |from the| public |
|00000c20| 73 63 72 61 70 20 74 6f | 20 54 65 78 74 45 64 69 |scrap to| TextEdi|
|00000c30| 74 27 73 20 73 63 72 61 | 70 20 72 69 67 68 74 20 |t's scra|p right |
|00000c40| 61 77 61 79 2c 0d 20 75 | 73 69 6e 67 20 74 68 65 |away,. u|sing the|
|00000c50| 20 54 45 54 6f 53 63 72 | 61 70 20 61 6e 64 20 54 | TEToScr|ap and T|
|00000c60| 45 46 72 6f 6d 53 63 72 | 61 70 20 72 6f 75 74 69 |EFromScr|ap routi|
|00000c70| 6e 65 73 2e 20 49 66 20 | 77 65 20 64 69 64 20 75 |nes. If |we did u|
|00000c80| 73 65 20 61 20 70 72 69 | 76 61 74 65 20 73 63 72 |se a pri|vate scr|
|00000c90| 61 70 2c 0d 20 74 68 65 | 20 69 6d 70 6f 72 74 2f |ap,. the| import/|
|00000ca0| 65 78 70 6f 72 74 20 77 | 6f 75 6c 64 20 62 65 20 |export w|ould be |
|00000cb0| 69 6e 20 74 68 65 20 61 | 63 74 69 76 61 74 65 2f |in the a|ctivate/|
|00000cc0| 64 65 61 63 74 69 76 61 | 74 65 20 65 76 65 6e 74 |deactiva|te event|
|00000cd0| 20 61 6e 64 20 73 75 73 | 70 65 6e 64 2f 72 65 73 | and sus|pend/res|
|00000ce0| 75 6d 65 0d 20 65 76 65 | 6e 74 20 72 6f 75 74 69 |ume. eve|nt routi|
|00000cf0| 6e 65 73 2e 7d 0d 0d 7b | 24 44 2b 7d 0d 0d 55 53 |nes.}..{|$D+}..US|
|00000d00| 45 53 0d 09 4d 65 6d 54 | 79 70 65 73 2c 20 51 75 |ES..MemT|ypes, Qu|
|00000d10| 69 63 6b 44 72 61 77 2c | 20 4f 53 49 6e 74 66 2c |ickDraw,| OSIntf,|
|00000d20| 20 54 6f 6f 6c 49 6e 74 | 66 3b 0d 0d 0d 43 4f 4e | ToolInt|f;...CON|
|00000d30| 53 54 0d 09 7b 4d 50 57 | 20 33 2e 30 20 77 69 6c |ST..{MPW| 3.0 wil|
|00000d40| 6c 20 69 6e 63 6c 75 64 | 65 20 61 20 54 72 61 70 |l includ|e a Trap|
|00000d50| 73 2e 70 20 69 6e 74 65 | 72 66 61 63 65 20 66 69 |s.p inte|rface fi|
|00000d60| 6c 65 20 74 68 61 74 20 | 69 6e 63 6c 75 64 65 73 |le that |includes|
|00000d70| 20 63 6f 6e 73 74 61 6e | 74 73 20 66 6f 72 20 74 | constan|ts for t|
|00000d80| 72 61 70 20 6e 75 6d 62 | 65 72 73 2e 0d 09 20 54 |rap numb|ers... T|
|00000d90| 68 65 73 65 20 63 6f 6e | 73 74 61 6e 74 73 20 61 |hese con|stants a|
|00000da0| 72 65 20 66 72 6f 6d 20 | 74 68 61 74 20 66 69 6c |re from |that fil|
|00000db0| 65 2e 7d 0d 09 5f 57 61 | 69 74 4e 65 78 74 45 76 |e.}.._Wa|itNextEv|
|00000dc0| 65 6e 74 09 09 09 3d 20 | 24 41 38 36 30 3b 0d 09 |ent...= |$A860;..|
|00000dd0| 5f 55 6e 69 6d 70 6c 65 | 6d 65 6e 74 65 64 09 09 |_Unimple|mented..|
|00000de0| 09 3d 20 24 41 38 39 46 | 3b 0d 0d 09 7b 54 65 78 |.= $A89F|;...{Tex|
|00000df0| 74 4d 61 72 67 69 6e 20 | 69 73 20 74 68 65 20 6e |tMargin |is the n|
|00000e00| 75 6d 62 65 72 20 6f 66 | 20 70 69 78 65 6c 73 20 |umber of| pixels |
|00000e10| 77 65 20 6c 65 61 76 65 | 20 62 6c 61 6e 6b 20 61 |we leave| blank a|
|00000e20| 74 20 74 68 65 20 65 64 | 67 65 20 6f 66 20 74 68 |t the ed|ge of th|
|00000e30| 65 20 77 69 6e 64 6f 77 | 2e 7d 0d 09 74 65 78 74 |e window|.}..text|
|00000e40| 4d 61 72 67 69 6e 09 09 | 09 09 3d 20 32 3b 0d 0d |Margin..|..= 2;..|
|00000e50| 09 7b 4d 61 78 4f 70 65 | 6e 44 6f 63 75 6d 65 6e |.{MaxOpe|nDocumen|
|00000e60| 74 73 20 69 73 20 75 73 | 65 64 20 74 6f 20 64 65 |ts is us|ed to de|
|00000e70| 74 65 72 6d 69 6e 65 20 | 77 68 65 74 68 65 72 20 |termine |whether |
|00000e80| 61 20 6e 65 77 20 64 6f | 63 75 6d 65 6e 74 20 63 |a new do|cument c|
|00000e90| 61 6e 20 62 65 20 6f 70 | 65 6e 65 64 0d 09 20 6f |an be op|ened.. o|
|00000ea0| 72 20 63 72 65 61 74 65 | 64 2e 20 57 65 20 6b 65 |r create|d. We ke|
|00000eb0| 65 70 20 74 72 61 63 6b | 20 6f 66 20 74 68 65 20 |ep track| of the |
|00000ec0| 6e 75 6d 62 65 72 20 6f | 66 20 6f 70 65 6e 20 64 |number o|f open d|
|00000ed0| 6f 63 75 6d 65 6e 74 73 | 2c 20 61 6e 64 20 64 69 |ocuments|, and di|
|00000ee0| 73 61 62 6c 65 20 74 68 | 65 0d 09 20 6d 65 6e 75 |sable th|e.. menu|
|00000ef0| 20 69 74 65 6d 73 20 74 | 68 61 74 20 63 72 65 61 | items t|hat crea|
|00000f00| 74 65 20 61 20 6e 65 77 | 20 64 6f 63 75 6d 65 6e |te a new| documen|
|00000f10| 74 20 77 68 65 6e 20 74 | 68 65 20 6d 61 78 69 6d |t when t|he maxim|
|00000f20| 75 6d 20 69 73 20 72 65 | 61 63 68 65 64 2e 20 49 |um is re|ached. I|
|00000f30| 66 20 74 68 65 0d 09 20 | 6e 75 6d 62 65 72 20 6f |f the.. |number o|
|00000f40| 66 20 64 6f 63 75 6d 65 | 6e 74 73 20 66 61 6c 6c |f docume|nts fall|
|00000f50| 73 20 62 65 6c 6f 77 20 | 74 68 65 20 6d 61 78 69 |s below |the maxi|
|00000f60| 6d 75 6d 2c 20 74 68 65 | 20 69 74 65 6d 73 20 61 |mum, the| items a|
|00000f70| 72 65 20 65 6e 61 62 6c | 65 64 20 61 67 61 69 6e |re enabl|ed again|
|00000f80| 2e 7d 0d 09 6d 61 78 4f | 70 65 6e 44 6f 63 75 6d |.}..maxO|penDocum|
|00000f90| 65 6e 74 73 09 09 3d 20 | 31 3b 0d 09 0d 09 7b 4d |ents..= |1;....{M|
|00000fa0| 61 78 44 6f 63 57 69 64 | 74 68 20 69 73 20 61 6e |axDocWid|th is an|
|00000fb0| 20 61 72 62 69 74 72 61 | 72 79 20 6e 75 6d 62 65 | arbitra|ry numbe|
|00000fc0| 72 20 75 73 65 64 20 74 | 6f 20 73 70 65 63 69 66 |r used t|o specif|
|00000fd0| 79 20 74 68 65 20 77 69 | 64 74 68 20 6f 66 20 74 |y the wi|dth of t|
|00000fe0| 68 65 20 54 45 52 65 63 | 27 73 0d 09 64 65 73 74 |he TERec|'s..dest|
|00000ff0| 69 6e 61 74 69 6f 6e 20 | 72 65 63 74 61 6e 67 6c |ination |rectangl|
|00001000| 65 20 73 6f 20 74 68 61 | 74 20 77 6f 72 64 20 77 |e so tha|t word w|
|00001010| 72 61 70 20 61 6e 64 20 | 68 6f 72 69 7a 6f 6e 74 |rap and |horizont|
|00001020| 61 6c 20 73 63 72 6f 6c | 6c 69 6e 67 20 63 61 6e |al scrol|ling can|
|00001030| 20 62 65 0d 09 64 65 6d | 6f 6e 73 74 72 61 74 65 | be..dem|onstrate|
|00001040| 64 2e 7d 0d 09 6d 61 78 | 44 6f 63 57 69 64 74 68 |d.}..max|DocWidth|
|00001050| 09 09 09 09 3d 20 35 37 | 36 3b 0d 09 0d 09 7b 4d |....= 57|6;....{M|
|00001060| 69 6e 44 6f 63 57 69 64 | 74 68 20 69 73 20 75 73 |inDocWid|th is us|
|00001070| 65 64 20 74 6f 20 6c 69 | 6d 69 74 20 74 68 65 20 |ed to li|mit the |
|00001080| 6d 69 6e 69 6d 75 6d 20 | 64 69 6d 65 6e 73 69 6f |minimum |dimensio|
|00001090| 6e 20 6f 66 20 61 20 77 | 69 6e 64 6f 77 20 77 68 |n of a w|indow wh|
|000010a0| 65 6e 20 47 72 6f 77 57 | 69 6e 64 6f 77 0d 09 69 |en GrowW|indow..i|
|000010b0| 73 20 63 61 6c 6c 65 64 | 2e 7d 0d 09 6d 69 6e 44 |s called|.}..minD|
|000010c0| 6f 63 44 69 6d 09 09 09 | 09 3d 20 36 34 3b 0d 09 |ocDim...|.= 64;..|
|000010d0| 0d 09 7b 43 6f 6e 74 72 | 6f 6c 49 6e 76 69 73 69 |..{Contr|olInvisi|
|000010e0| 62 6c 65 20 69 73 20 75 | 73 65 64 20 74 6f 20 27 |ble is u|sed to '|
|000010f0| 74 75 72 6e 20 6f 66 66 | 27 20 63 6f 6e 74 72 6f |turn off|' contro|
|00001100| 6c 73 20 28 69 2e 65 2e | 2c 20 63 61 75 73 65 20 |ls (i.e.|, cause |
|00001110| 74 68 65 20 63 6f 6e 74 | 72 6f 6c 20 6e 6f 74 0d |the cont|rol not.|
|00001120| 09 74 6f 20 62 65 20 72 | 65 64 72 61 77 6e 20 61 |.to be r|edrawn a|
|00001130| 73 20 61 20 72 65 73 75 | 6c 74 20 6f 66 20 73 6f |s a resu|lt of so|
|00001140| 6d 65 20 43 6f 6e 74 72 | 6f 6c 20 4d 61 6e 61 67 |me Contr|ol Manag|
|00001150| 65 72 20 63 61 6c 6c 20 | 73 75 63 68 20 61 73 20 |er call |such as |
|00001160| 53 65 74 43 74 6c 56 61 | 6c 75 65 29 0d 09 62 79 |SetCtlVa|lue)..by|
|00001170| 20 62 65 69 6e 67 20 70 | 75 74 20 69 6e 74 6f 20 | being p|ut into |
|00001180| 74 68 65 20 63 6f 6e 74 | 72 6c 56 69 73 20 66 69 |the cont|rlVis fi|
|00001190| 65 6c 64 20 6f 66 20 74 | 68 65 20 72 65 63 6f 72 |eld of t|he recor|
|000011a0| 64 2e 20 43 6f 6e 74 72 | 6f 6c 56 69 73 69 62 6c |d. Contr|olVisibl|
|000011b0| 65 20 69 73 20 75 73 65 | 64 0d 09 74 68 65 20 73 |e is use|d..the s|
|000011c0| 61 6d 65 20 77 61 79 20 | 74 6f 20 27 74 75 72 6e |ame way |to 'turn|
|000011d0| 20 6f 6e 27 20 74 68 65 | 20 63 6f 6e 74 72 6f 6c | on' the| control|
|000011e0| 2e 7d 0d 09 63 6f 6e 74 | 72 6f 6c 49 6e 76 69 73 |.}..cont|rolInvis|
|000011f0| 69 62 6c 65 09 09 3d 20 | 30 3b 0d 09 63 6f 6e 74 |ible..= |0;..cont|
|00001200| 72 6f 6c 56 69 73 69 62 | 6c 65 09 09 09 3d 20 24 |rolVisib|le...= $|
|00001210| 46 46 3b 0d 09 0d 09 7b | 53 63 72 6f 6c 6c 42 61 |FF;....{|ScrollBa|
|00001220| 72 41 64 6a 75 73 74 2c | 20 47 72 6f 77 42 6f 78 |rAdjust,| GrowBox|
|00001230| 41 64 6a 75 73 74 2c 20 | 61 6e 64 20 53 63 72 6f |Adjust, |and Scro|
|00001240| 6c 6c 42 61 72 20 77 69 | 64 74 68 20 61 72 65 20 |llBar wi|dth are |
|00001250| 75 73 65 64 20 69 6e 20 | 63 61 6c 63 75 6c 61 74 |used in |calculat|
|00001260| 69 6e 67 0d 09 76 61 6c | 75 65 73 20 66 6f 72 20 |ing..val|ues for |
|00001270| 63 6f 6e 74 72 6f 6c 20 | 70 6f 73 69 74 69 6f 6e |control |position|
|00001280| 69 6e 67 20 61 6e 64 20 | 73 69 7a 69 6e 67 2e 7d |ing and |sizing.}|
|00001290| 0d 09 73 63 72 6f 6c 6c | 62 61 72 41 64 6a 75 73 |..scroll|barAdjus|
|000012a0| 74 09 09 09 3d 20 31 35 | 3b 0d 09 67 72 6f 77 62 |t...= 15|;..growb|
|000012b0| 6f 78 41 64 6a 75 73 74 | 09 09 09 3d 20 31 33 3b |oxAdjust|...= 13;|
|000012c0| 0d 09 73 63 72 6f 6c 6c | 62 61 72 57 69 64 74 68 |..scroll|barWidth|
|000012d0| 09 09 09 3d 20 31 36 3b | 0d 09 0d 09 7b 43 72 43 |...= 16;|....{CrC|
|000012e0| 68 61 72 61 63 74 65 72 | 20 69 73 20 75 73 65 64 |haracter| is used|
|000012f0| 20 74 6f 20 63 6f 6d 70 | 61 72 65 20 66 6f 72 20 | to comp|are for |
|00001300| 61 20 63 61 72 72 69 61 | 67 65 20 72 65 74 75 72 |a carria|ge retur|
|00001310| 6e 20 77 68 65 6e 20 63 | 61 6c 63 75 6c 61 74 69 |n when c|alculati|
|00001320| 6e 67 20 74 68 65 0d 09 | 6e 75 6d 62 65 72 20 6f |ng the..|number o|
|00001330| 66 20 6c 69 6e 65 73 20 | 69 6e 20 74 68 65 20 54 |f lines |in the T|
|00001340| 65 78 74 45 64 69 74 20 | 72 65 63 6f 72 64 2e 7d |extEdit |record.}|
|00001350| 0d 09 63 72 43 68 61 72 | 61 63 74 65 72 09 09 09 |..crChar|acter...|
|00001360| 09 3d 20 31 33 3b 0d 09 | 0d 09 7b 42 75 74 74 6f |.= 13;..|..{Butto|
|00001370| 6e 53 63 72 6f 6c 6c 20 | 69 73 20 68 6f 77 20 6d |nScroll |is how m|
|00001380| 61 6e 79 20 70 69 78 65 | 6c 73 20 74 6f 20 73 63 |any pixe|ls to sc|
|00001390| 72 6f 6c 6c 20 68 6f 72 | 69 7a 6f 6e 74 61 6c 6c |roll hor|izontall|
|000013a0| 79 20 77 68 65 6e 20 74 | 68 65 20 62 75 74 74 6f |y when t|he butto|
|000013b0| 6e 20 70 61 72 74 0d 09 | 6f 66 20 74 68 65 20 68 |n part..|of the h|
|000013c0| 6f 72 69 7a 6f 6e 74 61 | 6c 20 73 63 72 6f 6c 6c |orizonta|l scroll|
|000013d0| 62 61 72 20 69 73 20 70 | 72 65 73 73 65 64 2e 7d |bar is p|ressed.}|
|000013e0| 0d 09 62 75 74 74 6f 6e | 53 63 72 6f 6c 6c 09 09 |..button|Scroll..|
|000013f0| 09 3d 20 34 3b 0d 09 0d | 09 7b 4d 61 78 54 45 4c |.= 4;...|.{MaxTEL|
|00001400| 65 6e 67 74 68 20 69 73 | 20 61 6e 20 61 72 62 69 |ength is| an arbi|
|00001410| 74 72 61 72 79 20 6e 75 | 6d 62 65 72 20 75 73 65 |trary nu|mber use|
|00001420| 64 20 74 6f 20 6c 69 6d | 69 74 20 74 68 65 20 6c |d to lim|it the l|
|00001430| 65 6e 67 74 68 20 6f 66 | 20 74 65 78 74 20 69 6e |ength of| text in|
|00001440| 20 74 68 65 20 54 45 52 | 65 63 0d 09 73 6f 20 74 | the TER|ec..so t|
|00001450| 68 61 74 20 76 61 72 69 | 6f 75 73 20 65 72 72 6f |hat vari|ous erro|
|00001460| 72 73 20 77 6f 6e 27 74 | 20 6f 63 63 75 72 20 66 |rs won't| occur f|
|00001470| 72 6f 6d 20 74 6f 6f 20 | 6d 61 6e 79 20 63 68 61 |rom too |many cha|
|00001480| 72 61 63 74 65 72 73 20 | 62 65 69 6e 67 20 69 6e |racters |being in|
|00001490| 20 74 68 65 20 74 65 78 | 74 2e 7d 0d 09 6d 61 78 | the tex|t.}..max|
|000014a0| 54 45 4c 65 6e 67 74 68 | 09 09 09 09 3d 20 33 32 |TELength|....= 32|
|000014b0| 30 30 30 3b 0d 0d 09 7b | 53 79 73 45 6e 76 69 72 |000;...{|SysEnvir|
|000014c0| 6f 6e 73 56 65 72 73 69 | 6f 6e 20 69 73 20 70 61 |onsVersi|on is pa|
|000014d0| 73 73 65 64 20 74 6f 20 | 53 79 73 45 6e 76 69 72 |ssed to |SysEnvir|
|000014e0| 6f 6e 73 20 74 6f 20 74 | 65 6c 6c 20 69 74 20 77 |ons to t|ell it w|
|000014f0| 68 69 63 68 20 76 65 72 | 73 69 6f 6e 20 6f 66 20 |hich ver|sion of |
|00001500| 74 68 65 0d 09 20 53 79 | 73 45 6e 76 52 65 63 20 |the.. Sy|sEnvRec |
|00001510| 77 65 20 75 6e 64 65 72 | 73 74 61 6e 64 2e 7d 0d |we under|stand.}.|
|00001520| 09 73 79 73 45 6e 76 69 | 72 6f 6e 73 56 65 72 73 |.sysEnvi|ronsVers|
|00001530| 69 6f 6e 09 09 3d 20 31 | 3b 0d 0d 09 7b 4f 53 45 |ion..= 1|;...{OSE|
|00001540| 76 65 6e 74 20 69 73 20 | 74 68 65 20 65 76 65 6e |vent is |the even|
|00001550| 74 20 6e 75 6d 62 65 72 | 20 6f 66 20 74 68 65 20 |t number| of the |
|00001560| 73 75 73 70 65 6e 64 2f | 72 65 73 75 6d 65 20 61 |suspend/|resume a|
|00001570| 6e 64 20 6d 6f 75 73 65 | 2d 6d 6f 76 65 64 20 65 |nd mouse|-moved e|
|00001580| 76 65 6e 74 73 20 73 65 | 6e 74 0d 09 20 62 79 20 |vents se|nt.. by |
|00001590| 4d 75 6c 74 69 46 69 6e | 64 65 72 2e 20 4f 6e 63 |MultiFin|der. Onc|
|000015a0| 65 20 77 65 20 64 65 74 | 65 72 6d 69 6e 65 20 74 |e we det|ermine t|
|000015b0| 68 61 74 20 61 6e 20 65 | 76 65 6e 74 20 69 73 20 |hat an e|vent is |
|000015c0| 61 6e 20 6f 73 45 76 65 | 6e 74 2c 20 77 65 20 6c |an osEve|nt, we l|
|000015d0| 6f 6f 6b 20 61 74 20 74 | 68 65 0d 09 20 68 69 67 |ook at t|he.. hig|
|000015e0| 68 20 62 79 74 65 20 6f | 66 20 74 68 65 20 6d 65 |h byte o|f the me|
|000015f0| 73 73 61 67 65 20 73 65 | 6e 74 20 74 6f 20 64 65 |ssage se|nt to de|
|00001600| 74 65 72 6d 69 6e 65 20 | 77 68 69 63 68 20 6b 69 |termine |which ki|
|00001610| 6e 64 20 69 74 20 69 73 | 2e 20 54 6f 20 64 69 66 |nd it is|. To dif|
|00001620| 66 65 72 65 6e 74 69 61 | 74 65 0d 09 20 73 75 73 |ferentia|te.. sus|
|00001630| 70 65 6e 64 20 61 6e 64 | 20 72 65 73 75 6d 65 20 |pend and| resume |
|00001640| 65 76 65 6e 74 73 20 77 | 65 20 63 68 65 63 6b 20 |events w|e check |
|00001650| 74 68 65 20 72 65 73 75 | 6d 65 4d 61 73 6b 20 62 |the resu|meMask b|
|00001660| 69 74 2e 7d 0d 09 6f 73 | 45 76 65 6e 74 09 09 09 |it.}..os|Event...|
|00001670| 09 09 3d 20 61 70 70 34 | 45 76 74 3b 09 7b 65 76 |..= app4|Evt;.{ev|
|00001680| 65 6e 74 20 75 73 65 64 | 20 62 79 20 4d 75 6c 74 |ent used| by Mult|
|00001690| 69 46 69 6e 64 65 72 7d | 0d 09 73 75 73 70 65 6e |iFinder}|..suspen|
|000016a0| 64 52 65 73 75 6d 65 4d | 65 73 73 61 67 65 09 3d |dResumeM|essage.=|
|000016b0| 20 31 3b 09 09 7b 68 69 | 67 68 20 62 79 74 65 20 | 1;..{hi|gh byte |
|000016c0| 6f 66 20 73 75 73 70 65 | 6e 64 2f 72 65 73 75 6d |of suspe|nd/resum|
|000016d0| 65 20 65 76 65 6e 74 20 | 6d 65 73 73 61 67 65 7d |e event |message}|
|000016e0| 0d 09 72 65 73 75 6d 65 | 4d 61 73 6b 09 09 09 09 |..resume|Mask....|
|000016f0| 3d 20 31 3b 09 09 7b 62 | 69 74 20 6f 66 20 6d 65 |= 1;..{b|it of me|
|00001700| 73 73 61 67 65 20 66 69 | 65 6c 64 20 66 6f 72 20 |ssage fi|eld for |
|00001710| 72 65 73 75 6d 65 20 76 | 73 2e 20 73 75 73 70 65 |resume v|s. suspe|
|00001720| 6e 64 7d 0d 09 6d 6f 75 | 73 65 4d 6f 76 65 64 4d |nd}..mou|seMovedM|
|00001730| 65 73 73 61 67 65 09 09 | 3d 20 24 46 41 3b 09 09 |essage..|= $FA;..|
|00001740| 7b 68 69 67 68 20 62 79 | 74 65 20 6f 66 20 6d 6f |{high by|te of mo|
|00001750| 75 73 65 2d 6d 6f 76 65 | 64 20 65 76 65 6e 74 20 |use-move|d event |
|00001760| 6d 65 73 73 61 67 65 7d | 0d 0d 09 7b 4b 4d 69 6e |message}|...{KMin|
|00001770| 53 69 7a 65 20 69 73 20 | 74 68 65 20 6d 69 6e 69 |Size is |the mini|
|00001780| 6d 75 6d 20 73 69 7a 65 | 20 28 69 6e 20 4b 29 20 |mum size| (in K) |
|00001790| 66 6f 72 20 74 68 65 20 | 61 70 70 6c 69 63 61 74 |for the |applicat|
|000017a0| 69 6f 6e 20 74 6f 20 72 | 75 6e 2e 7d 0d 09 6b 4d |ion to r|un.}..kM|
|000017b0| 69 6e 53 69 7a 65 09 3d | 20 34 30 3b 0d 09 0d 09 |inSize.=| 40;....|
|000017c0| 7b 45 78 74 72 65 6d 65 | 4e 65 67 20 61 6e 64 20 |{Extreme|Neg and |
|000017d0| 45 78 74 72 65 6d 65 50 | 6f 73 20 61 72 65 20 75 |ExtremeP|os are u|
|000017e0| 73 65 64 20 74 6f 20 73 | 65 74 20 75 70 20 77 69 |sed to s|et up wi|
|000017f0| 64 65 20 6f 70 65 6e 20 | 72 65 63 74 61 6e 67 6c |de open |rectangl|
|00001800| 65 73 20 61 6e 64 20 72 | 65 67 69 6f 6e 73 2e 7d |es and r|egions.}|
|00001810| 0d 09 65 78 74 72 65 6d | 65 4e 65 67 09 09 09 09 |..extrem|eNeg....|
|00001820| 3d 20 2d 33 32 37 36 38 | 3b 0d 09 65 78 74 72 65 |= -32768|;..extre|
|00001830| 6d 65 50 6f 73 09 09 09 | 09 3d 20 33 32 37 36 37 |mePos...|.= 32767|
|00001840| 20 2d 20 31 3b 09 7b 72 | 65 71 75 69 72 65 64 20 | - 1;.{r|equired |
|00001850| 66 6f 72 20 6f 6c 64 20 | 72 65 67 69 6f 6e 20 62 |for old |region b|
|00001860| 75 67 7d 0d 09 0d 09 7b | 54 68 65 20 66 6f 6c 6c |ug}....{|The foll|
|00001870| 6f 77 69 6e 67 20 63 6f | 6e 73 74 61 6e 74 73 20 |owing co|nstants |
|00001880| 61 72 65 20 61 6c 6c 20 | 72 65 73 6f 75 72 63 65 |are all |resource|
|00001890| 20 49 44 73 2c 20 63 6f | 72 72 65 73 70 6f 6e 64 | IDs, co|rrespond|
|000018a0| 69 6e 67 20 74 6f 20 72 | 65 73 6f 75 72 63 65 73 |ing to r|esources|
|000018b0| 20 69 6e 20 53 61 6d 70 | 6c 65 2e 72 2e 7d 0d 09 | in Samp|le.r.}..|
|000018c0| 72 4d 65 6e 75 42 61 72 | 09 3d 20 31 32 38 3b 09 |rMenuBar|.= 128;.|
|000018d0| 09 09 09 09 7b 61 70 70 | 6c 69 63 61 74 69 6f 6e |....{app|lication|
|000018e0| 27 73 20 6d 65 6e 75 20 | 62 61 72 7d 0d 09 72 41 |'s menu |bar}..rA|
|000018f0| 62 6f 75 74 41 6c 65 72 | 74 09 3d 20 31 32 38 3b |boutAler|t.= 128;|
|00001900| 09 09 09 09 09 7b 61 62 | 6f 75 74 20 61 6c 65 72 |.....{ab|out aler|
|00001910| 74 7d 0d 09 72 45 64 69 | 74 41 6c 65 72 74 09 3d |t}..rEdi|tAlert.=|
|00001920| 20 31 32 39 3b 09 09 09 | 09 09 7b 65 64 69 74 20 | 129;...|..{edit |
|00001930| 65 72 72 6f 72 20 61 6c | 65 72 74 7d 0d 09 72 44 |error al|ert}..rD|
|00001940| 6f 63 57 69 6e 64 6f 77 | 09 3d 20 31 32 38 3b 09 |ocWindow|.= 128;.|
|00001950| 09 09 09 09 7b 61 70 70 | 6c 69 63 61 74 69 6f 6e |....{app|lication|
|00001960| 27 73 20 77 69 6e 64 6f | 77 7d 0d 09 72 56 53 63 |'s windo|w}..rVSc|
|00001970| 72 6f 6c 6c 09 3d 20 31 | 32 38 3b 09 09 09 09 09 |roll.= 1|28;.....|
|00001980| 7b 76 65 72 74 69 63 61 | 6c 20 73 63 72 6f 6c 6c |{vertica|l scroll|
|00001990| 62 61 72 20 63 6f 6e 74 | 72 6f 6c 7d 0d 09 72 48 |bar cont|rol}..rH|
|000019a0| 53 63 72 6f 6c 6c 09 3d | 20 31 32 39 3b 09 09 09 |Scroll.=| 129;...|
|000019b0| 09 09 7b 68 6f 72 69 7a | 6f 6e 74 61 6c 20 73 63 |..{horiz|ontal sc|
|000019c0| 72 6f 6c 6c 62 61 72 20 | 63 6f 6e 74 72 6f 6c 7d |rollbar |control}|
|000019d0| 0d 0d 09 7b 54 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |...{The |followin|
|000019e0| 67 20 63 6f 6e 73 74 61 | 6e 74 73 20 61 72 65 20 |g consta|nts are |
|000019f0| 75 73 65 64 20 74 6f 20 | 69 64 65 6e 74 69 66 79 |used to |identify|
|00001a00| 20 6d 65 6e 75 73 20 61 | 6e 64 20 74 68 65 69 72 | menus a|nd their|
|00001a10| 20 69 74 65 6d 73 2e 20 | 54 68 65 20 6d 65 6e 75 | items. |The menu|
|00001a20| 20 49 44 73 0d 09 20 68 | 61 76 65 20 61 6e 20 22 | IDs.. h|ave an "|
|00001a30| 6d 22 20 70 72 65 66 69 | 78 20 61 6e 64 20 74 68 |m" prefi|x and th|
|00001a40| 65 20 69 74 65 6d 20 6e | 75 6d 62 65 72 73 20 77 |e item n|umbers w|
|00001a50| 69 74 68 69 6e 20 65 61 | 63 68 20 6d 65 6e 75 20 |ithin ea|ch menu |
|00001a60| 68 61 76 65 20 61 6e 20 | 22 69 22 20 70 72 65 66 |have an |"i" pref|
|00001a70| 69 78 2e 7d 0d 09 6d 41 | 70 70 6c 65 09 09 3d 20 |ix.}..mA|pple..= |
|00001a80| 31 32 38 3b 09 09 09 09 | 09 7b 41 70 70 6c 65 20 |128;....|.{Apple |
|00001a90| 6d 65 6e 75 7d 0d 09 69 | 41 62 6f 75 74 09 09 3d |menu}..i|About..=|
|00001aa0| 20 31 3b 0d 0d 09 6d 46 | 69 6c 65 09 09 3d 20 31 | 1;...mF|ile..= 1|
|00001ab0| 32 39 3b 09 09 09 09 09 | 7b 46 69 6c 65 20 6d 65 |29;.....|{File me|
|00001ac0| 6e 75 7d 0d 09 69 4e 65 | 77 09 09 3d 20 31 3b 0d |nu}..iNe|w..= 1;.|
|00001ad0| 09 69 43 6c 6f 73 65 09 | 09 3d 20 34 3b 0d 09 69 |.iClose.|.= 4;..i|
|00001ae0| 51 75 69 74 09 09 3d 20 | 31 32 3b 0d 0d 09 6d 45 |Quit..= |12;...mE|
|00001af0| 64 69 74 09 09 3d 20 31 | 33 30 3b 09 09 09 09 09 |dit..= 1|30;.....|
|00001b00| 7b 45 64 69 74 20 6d 65 | 6e 75 7d 0d 09 69 55 6e |{Edit me|nu}..iUn|
|00001b10| 64 6f 09 09 3d 20 31 3b | 0d 09 69 43 75 74 09 09 |do..= 1;|..iCut..|
|00001b20| 3d 20 33 3b 0d 09 69 43 | 6f 70 79 09 09 3d 20 34 |= 3;..iC|opy..= 4|
|00001b30| 3b 0d 09 69 50 61 73 74 | 65 09 09 3d 20 35 3b 0d |;..iPast|e..= 5;.|
|00001b40| 09 69 43 6c 65 61 72 09 | 09 3d 20 36 3b 0d 0d 0d |.iClear.|.= 6;...|
|00001b50| 54 59 50 45 0d 09 7b 41 | 20 44 6f 63 75 6d 65 6e |TYPE..{A| Documen|
|00001b60| 74 52 65 63 6f 72 64 20 | 63 6f 6e 74 61 69 6e 73 |tRecord |contains|
|00001b70| 20 74 68 65 20 57 69 6e | 64 6f 77 52 65 63 6f 72 | the Win|dowRecor|
|00001b80| 64 20 66 6f 72 20 6f 6e | 65 20 6f 66 20 6f 75 72 |d for on|e of our|
|00001b90| 20 64 6f 63 75 6d 65 6e | 74 20 77 69 6e 64 6f 77 | documen|t window|
|00001ba0| 73 2c 0d 09 20 61 73 20 | 77 65 6c 6c 20 61 73 20 |s,.. as |well as |
|00001bb0| 74 68 65 20 54 45 48 61 | 6e 64 6c 65 20 66 6f 72 |the TEHa|ndle for|
|00001bc0| 20 74 68 65 20 74 65 78 | 74 20 77 65 20 61 72 65 | the tex|t we are|
|00001bd0| 20 65 64 69 74 69 6e 67 | 2e 20 57 65 20 68 61 76 | editing|. We hav|
|00001be0| 65 20 61 64 64 65 64 20 | 66 69 65 6c 64 73 20 74 |e added |fields t|
|00001bf0| 6f 0d 09 20 68 6f 6c 64 | 20 74 68 65 20 43 6f 6e |o.. hold| the Con|
|00001c00| 74 72 6f 6c 48 61 6e 64 | 6c 65 73 20 74 6f 20 74 |trolHand|les to t|
|00001c10| 68 65 20 76 65 72 74 69 | 63 61 6c 20 61 6e 64 20 |he verti|cal and |
|00001c20| 68 6f 72 69 7a 6f 6e 74 | 61 6c 20 73 63 72 6f 6c |horizont|al scrol|
|00001c30| 6c 62 61 72 73 20 61 6e | 64 20 74 6f 20 68 6f 6c |lbars an|d to hol|
|00001c40| 64 0d 09 20 74 68 65 20 | 61 64 64 72 65 73 73 20 |d.. the |address |
|00001c50| 6f 66 20 74 68 65 20 64 | 65 66 61 75 6c 74 20 63 |of the d|efault c|
|00001c60| 6c 69 6b 4c 6f 6f 70 20 | 74 68 61 74 20 67 65 74 |likLoop |that get|
|00001c70| 73 20 61 74 74 61 63 68 | 65 64 20 74 6f 20 61 20 |s attach|ed to a |
|00001c80| 54 45 52 65 63 20 77 68 | 65 6e 20 79 6f 75 20 63 |TERec wh|en you c|
|00001c90| 61 6c 6c 0d 09 20 54 45 | 41 75 74 6f 56 69 65 77 |all.. TE|AutoView|
|00001ca0| 2e 20 4f 74 68 65 72 20 | 64 6f 63 75 6d 65 6e 74 |. Other |document|
|00001cb0| 20 66 69 65 6c 64 73 20 | 63 61 6e 20 62 65 20 61 | fields |can be a|
|00001cc0| 64 64 65 64 20 74 6f 20 | 74 68 69 73 20 72 65 63 |dded to |this rec|
|00001cd0| 6f 72 64 20 61 73 20 6e | 65 65 64 65 64 2e 20 46 |ord as n|eeded. F|
|00001ce0| 6f 72 0d 09 20 61 20 73 | 69 6d 69 6c 61 72 20 65 |or.. a s|imilar e|
|00001cf0| 78 61 6d 70 6c 65 2c 20 | 73 65 65 20 68 6f 77 20 |xample, |see how |
|00001d00| 74 68 65 20 57 69 6e 64 | 6f 77 20 4d 61 6e 61 67 |the Wind|ow Manag|
|00001d10| 65 72 20 61 6e 64 20 44 | 69 61 6c 6f 67 20 4d 61 |er and D|ialog Ma|
|00001d20| 6e 61 67 65 72 20 61 64 | 64 20 66 69 65 6c 64 73 |nager ad|d fields|
|00001d30| 0d 09 20 61 66 74 65 72 | 20 74 68 65 20 47 72 61 |.. after| the Gra|
|00001d40| 66 50 6f 72 74 2e 7d 0d | 09 44 6f 63 75 6d 65 6e |fPort.}.|.Documen|
|00001d50| 74 52 65 63 6f 72 64 09 | 3d 20 52 45 43 4f 52 44 |tRecord.|= RECORD|
|00001d60| 0d 09 09 64 6f 63 57 69 | 6e 64 6f 77 09 3a 20 57 |...docWi|ndow.: W|
|00001d70| 69 6e 64 6f 77 52 65 63 | 6f 72 64 3b 0d 09 09 64 |indowRec|ord;...d|
|00001d80| 6f 63 54 45 09 09 3a 20 | 54 45 48 61 6e 64 6c 65 |ocTE..: |TEHandle|
|00001d90| 3b 0d 09 09 64 6f 63 56 | 53 63 72 6f 6c 6c 09 3a |;...docV|Scroll.:|
|00001da0| 20 43 6f 6e 74 72 6f 6c | 48 61 6e 64 6c 65 3b 0d | Control|Handle;.|
|00001db0| 09 09 64 6f 63 48 53 63 | 72 6f 6c 6c 09 3a 20 43 |..docHSc|roll.: C|
|00001dc0| 6f 6e 74 72 6f 6c 48 61 | 6e 64 6c 65 3b 0d 09 09 |ontrolHa|ndle;...|
|00001dd0| 64 6f 63 43 6c 69 6b 09 | 09 3a 20 50 72 6f 63 50 |docClik.|.: ProcP|
|00001de0| 74 72 3b 0d 09 45 4e 44 | 3b 0d 09 44 6f 63 75 6d |tr;..END|;..Docum|
|00001df0| 65 6e 74 50 65 65 6b 09 | 3d 20 5e 44 6f 63 75 6d |entPeek.|= ^Docum|
|00001e00| 65 6e 74 52 65 63 6f 72 | 64 3b 0d 0d 0d 56 41 52 |entRecor|d;...VAR|
|00001e10| 0d 09 7b 54 68 65 20 22 | 67 22 20 70 72 65 66 69 |..{The "|g" prefi|
|00001e20| 78 20 69 73 20 75 73 65 | 64 20 74 6f 20 65 6d 70 |x is use|d to emp|
|00001e30| 68 61 73 69 7a 65 20 74 | 68 61 74 20 61 20 76 61 |hasize t|hat a va|
|00001e40| 72 69 61 62 6c 65 20 69 | 73 20 67 6c 6f 62 61 6c |riable i|s global|
|00001e50| 2e 7d 0d 0d 09 7b 47 4d | 61 63 20 69 73 20 75 73 |.}...{GM|ac is us|
|00001e60| 65 64 20 74 6f 20 68 6f | 6c 64 20 74 68 65 20 72 |ed to ho|ld the r|
|00001e70| 65 73 75 6c 74 20 6f 66 | 20 61 20 53 79 73 45 6e |esult of| a SysEn|
|00001e80| 76 69 72 6f 6e 73 20 63 | 61 6c 6c 2e 20 54 68 69 |virons c|all. Thi|
|00001e90| 73 20 6d 61 6b 65 73 0d | 09 20 69 74 20 63 6f 6e |s makes.|. it con|
|00001ea0| 76 65 6e 69 65 6e 74 20 | 66 6f 72 20 61 6e 79 20 |venient |for any |
|00001eb0| 72 6f 75 74 69 6e 65 20 | 74 6f 20 63 68 65 63 6b |routine |to check|
|00001ec0| 20 74 68 65 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 | the env|ironment|
|00001ed0| 2e 7d 0d 09 67 4d 61 63 | 09 09 09 09 3a 20 53 79 |.}..gMac|....: Sy|
|00001ee0| 73 45 6e 76 52 65 63 3b | 09 7b 73 65 74 20 75 70 |sEnvRec;|.{set up|
|00001ef0| 20 62 79 20 49 6e 69 74 | 69 61 6c 69 7a 65 7d 0d | by Init|ialize}.|
|00001f00| 0d 09 7b 47 48 61 73 57 | 61 69 74 4e 65 78 74 45 |..{GHasW|aitNextE|
|00001f10| 76 65 6e 74 20 69 73 20 | 73 65 74 20 61 74 20 73 |vent is |set at s|
|00001f20| 74 61 72 74 75 70 2c 20 | 61 6e 64 20 74 65 6c 6c |tartup, |and tell|
|00001f30| 73 20 77 68 65 74 68 65 | 72 20 74 68 65 20 57 61 |s whethe|r the Wa|
|00001f40| 69 74 4e 65 78 74 45 76 | 65 6e 74 0d 09 20 74 72 |itNextEv|ent.. tr|
|00001f50| 61 70 20 69 73 20 61 76 | 61 69 6c 61 62 6c 65 2e |ap is av|ailable.|
|00001f60| 20 49 66 20 69 74 20 69 | 73 20 66 61 6c 73 65 2c | If it i|s false,|
|00001f70| 20 77 65 20 6b 6e 6f 77 | 20 74 68 61 74 20 77 65 | we know| that we|
|00001f80| 20 6d 75 73 74 20 63 61 | 6c 6c 20 47 65 74 4e 65 | must ca|ll GetNe|
|00001f90| 78 74 45 76 65 6e 74 2e | 7d 0d 09 67 48 61 73 57 |xtEvent.|}..gHasW|
|00001fa0| 61 69 74 4e 65 78 74 45 | 76 65 6e 74 09 3a 20 42 |aitNextE|vent.: B|
|00001fb0| 4f 4f 4c 45 41 4e 3b 09 | 09 7b 73 65 74 20 75 70 |OOLEAN;.|.{set up|
|00001fc0| 20 62 79 20 49 6e 69 74 | 69 61 6c 69 7a 65 7d 0d | by Init|ialize}.|
|00001fd0| 0d 09 7b 47 49 6e 42 61 | 63 6b 67 72 6f 75 6e 64 |..{GInBa|ckground|
|00001fe0| 20 69 73 20 6d 61 69 6e | 74 61 69 6e 65 64 20 62 | is main|tained b|
|00001ff0| 79 20 6f 75 72 20 6f 73 | 45 76 65 6e 74 20 68 61 |y our os|Event ha|
|00002000| 6e 64 6c 69 6e 67 20 72 | 6f 75 74 69 6e 65 73 2e |ndling r|outines.|
|00002010| 20 41 6e 79 20 70 61 72 | 74 20 6f 66 0d 09 20 74 | Any par|t of.. t|
|00002020| 68 65 20 70 72 6f 67 72 | 61 6d 20 63 61 6e 20 63 |he progr|am can c|
|00002030| 68 65 63 6b 20 69 74 20 | 74 6f 20 66 69 6e 64 20 |heck it |to find |
|00002040| 6f 75 74 20 69 66 20 69 | 74 20 69 73 20 63 75 72 |out if i|t is cur|
|00002050| 72 65 6e 74 6c 79 20 69 | 6e 20 74 68 65 20 62 61 |rently i|n the ba|
|00002060| 63 6b 67 72 6f 75 6e 64 | 2e 7d 0d 09 67 49 6e 42 |ckground|.}..gInB|
|00002070| 61 63 6b 67 72 6f 75 6e | 64 09 09 3a 20 42 4f 4f |ackgroun|d..: BOO|
|00002080| 4c 45 41 4e 3b 09 09 7b | 6d 61 69 6e 74 61 69 6e |LEAN;..{|maintain|
|00002090| 65 64 20 62 79 20 49 6e | 69 74 69 61 6c 69 7a 65 |ed by In|itialize|
|000020a0| 20 61 6e 64 20 44 6f 45 | 76 65 6e 74 7d 0d 0d 09 | and DoE|vent}...|
|000020b0| 7b 47 4e 75 6d 44 6f 63 | 75 6d 65 6e 74 73 20 69 |{GNumDoc|uments i|
|000020c0| 73 20 75 73 65 64 20 74 | 6f 20 6b 65 65 70 20 74 |s used t|o keep t|
|000020d0| 72 61 63 6b 20 6f 66 20 | 68 6f 77 20 6d 61 6e 79 |rack of |how many|
|000020e0| 20 6f 70 65 6e 20 64 6f | 63 75 6d 65 6e 74 73 20 | open do|cuments |
|000020f0| 74 68 65 72 65 20 61 72 | 65 0d 09 20 61 74 20 61 |there ar|e.. at a|
|00002100| 6e 79 20 74 69 6d 65 2e | 20 49 74 20 69 73 20 6d |ny time.| It is m|
|00002110| 61 69 6e 74 61 69 6e 65 | 64 20 62 79 20 74 68 65 |aintaine|d by the|
|00002120| 20 72 6f 75 74 69 6e 65 | 73 20 74 68 61 74 20 6f | routine|s that o|
|00002130| 70 65 6e 20 61 6e 64 20 | 63 6c 6f 73 65 20 64 6f |pen and |close do|
|00002140| 63 75 6d 65 6e 74 73 2e | 7d 0d 09 67 4e 75 6d 44 |cuments.|}..gNumD|
|00002150| 6f 63 75 6d 65 6e 74 73 | 09 09 3a 20 49 4e 54 45 |ocuments|..: INTE|
|00002160| 47 45 52 3b 09 09 7b 6d | 61 69 6e 74 61 69 6e 65 |GER;..{m|aintaine|
|00002170| 64 20 62 79 20 49 6e 69 | 74 69 61 6c 69 7a 65 2c |d by Ini|tialize,|
|00002180| 20 44 6f 4e 65 77 2c 20 | 61 6e 64 20 44 6f 43 6c | DoNew, |and DoCl|
|00002190| 6f 73 65 57 69 6e 64 6f | 77 7d 0d 0d 09 0d 7b 24 |oseWindo|w}....{$|
|000021a0| 53 20 49 6e 69 74 69 61 | 6c 69 7a 65 7d 0d 46 55 |S Initia|lize}.FU|
|000021b0| 4e 43 54 49 4f 4e 20 54 | 72 61 70 41 76 61 69 6c |NCTION T|rapAvail|
|000021c0| 61 62 6c 65 28 74 4e 75 | 6d 62 65 72 3a 20 49 4e |able(tNu|mber: IN|
|000021d0| 54 45 47 45 52 3b 20 74 | 54 79 70 65 3a 20 54 72 |TEGER; t|Type: Tr|
|000021e0| 61 70 54 79 70 65 29 3a | 20 42 4f 4f 4c 45 41 4e |apType):| BOOLEAN|
|000021f0| 3b 0d 0d 7b 43 68 65 63 | 6b 20 74 6f 20 73 65 65 |;..{Chec|k to see|
|00002200| 20 69 66 20 61 20 67 69 | 76 65 6e 20 74 72 61 70 | if a gi|ven trap|
|00002210| 20 69 73 20 69 6d 70 6c | 65 6d 65 6e 74 65 64 2e | is impl|emented.|
|00002220| 20 54 68 69 73 20 69 73 | 20 6f 6e 6c 79 20 75 73 | This is| only us|
|00002230| 65 64 20 62 79 20 74 68 | 65 0d 20 49 6e 69 74 69 |ed by th|e. Initi|
|00002240| 61 6c 69 7a 65 20 72 6f | 75 74 69 6e 65 20 69 6e |alize ro|utine in|
|00002250| 20 74 68 69 73 20 70 72 | 6f 67 72 61 6d 2c 20 73 | this pr|ogram, s|
|00002260| 6f 20 77 65 20 70 75 74 | 20 69 74 20 69 6e 20 74 |o we put| it in t|
|00002270| 68 65 20 49 6e 69 74 69 | 61 6c 69 7a 65 20 73 65 |he Initi|alize se|
|00002280| 67 6d 65 6e 74 2e 7d 0d | 0d 42 45 47 49 4e 0d 09 |gment.}.|.BEGIN..|
|00002290| 7b 43 68 65 63 6b 20 61 | 6e 64 20 73 65 65 20 69 |{Check a|nd see i|
|000022a0| 66 20 74 68 65 20 74 72 | 61 70 20 65 78 69 73 74 |f the tr|ap exist|
|000022b0| 73 2e 20 4f 6e 20 36 34 | 4b 20 52 4f 4d 20 6d 61 |s. On 64|K ROM ma|
|000022c0| 63 68 69 6e 65 73 2c 20 | 74 54 79 70 65 20 77 69 |chines, |tType wi|
|000022d0| 6c 6c 20 62 65 20 69 67 | 6e 6f 72 65 64 2e 7d 0d |ll be ig|nored.}.|
|000022e0| 0d 09 54 72 61 70 41 76 | 61 69 6c 61 62 6c 65 20 |..TrapAv|ailable |
|000022f0| 3a 3d 20 4e 47 65 74 54 | 72 61 70 41 64 64 72 65 |:= NGetT|rapAddre|
|00002300| 73 73 28 74 4e 75 6d 62 | 65 72 2c 20 74 54 79 70 |ss(tNumb|er, tTyp|
|00002310| 65 29 20 3c 3e 20 47 65 | 74 54 72 61 70 41 64 64 |e) <> Ge|tTrapAdd|
|00002320| 72 65 73 73 28 5f 55 6e | 69 6d 70 6c 65 6d 65 6e |ress(_Un|implemen|
|00002330| 74 65 64 29 3b 0d 45 4e | 44 3b 20 7b 54 72 61 70 |ted);.EN|D; {Trap|
|00002340| 41 76 61 69 6c 61 62 6c | 65 7d 0d 0d 0d 7b 24 53 |Availabl|e}...{$S|
|00002350| 20 4d 61 69 6e 7d 0d 46 | 55 4e 43 54 49 4f 4e 20 | Main}.F|UNCTION |
|00002360| 49 73 44 41 57 69 6e 64 | 6f 77 28 77 69 6e 64 6f |IsDAWind|ow(windo|
|00002370| 77 3a 20 57 69 6e 64 6f | 77 50 74 72 29 3a 20 42 |w: Windo|wPtr): B|
|00002380| 4f 4f 4c 45 41 4e 3b 0d | 0d 7b 43 68 65 63 6b 20 |OOLEAN;.|.{Check |
|00002390| 69 66 20 61 20 77 69 6e | 64 6f 77 20 62 65 6c 6f |if a win|dow belo|
|000023a0| 6e 67 73 20 74 6f 20 61 | 20 64 65 73 6b 20 61 63 |ngs to a| desk ac|
|000023b0| 63 65 73 73 6f 72 79 2e | 7d 0d 0d 42 45 47 49 4e |cessory.|}..BEGIN|
|000023c0| 0d 09 49 46 20 77 69 6e | 64 6f 77 20 3d 20 4e 49 |..IF win|dow = NI|
|000023d0| 4c 20 54 48 45 4e 0d 09 | 09 49 73 44 41 57 69 6e |L THEN..|.IsDAWin|
|000023e0| 64 6f 77 20 3a 3d 20 46 | 41 4c 53 45 0d 09 45 4c |dow := F|ALSE..EL|
|000023f0| 53 45 09 7b 44 41 20 77 | 69 6e 64 6f 77 73 20 68 |SE.{DA w|indows h|
|00002400| 61 76 65 20 6e 65 67 61 | 74 69 76 65 20 77 69 6e |ave nega|tive win|
|00002410| 64 6f 77 4b 69 6e 64 73 | 7d 0d 09 09 49 73 44 41 |dowKinds|}...IsDA|
|00002420| 57 69 6e 64 6f 77 20 3a | 3d 20 57 69 6e 64 6f 77 |Window :|= Window|
|00002430| 50 65 65 6b 28 77 69 6e | 64 6f 77 29 5e 2e 77 69 |Peek(win|dow)^.wi|
|00002440| 6e 64 6f 77 4b 69 6e 64 | 20 3c 20 30 3b 0d 45 4e |ndowKind| < 0;.EN|
|00002450| 44 3b 20 7b 49 73 44 41 | 57 69 6e 64 6f 77 7d 0d |D; {IsDA|Window}.|
|00002460| 0d 0d 7b 24 53 20 4d 61 | 69 6e 7d 0d 46 55 4e 43 |..{$S Ma|in}.FUNC|
|00002470| 54 49 4f 4e 20 49 73 41 | 70 70 57 69 6e 64 6f 77 |TION IsA|ppWindow|
|00002480| 28 77 69 6e 64 6f 77 3a | 20 57 69 6e 64 6f 77 50 |(window:| WindowP|
|00002490| 74 72 29 3a 20 42 4f 4f | 4c 45 41 4e 3b 0d 0d 7b |tr): BOO|LEAN;..{|
|000024a0| 43 68 65 63 6b 20 69 66 | 20 61 20 77 69 6e 64 6f |Check if| a windo|
|000024b0| 77 20 62 65 6c 6f 6e 67 | 73 20 74 6f 20 74 68 65 |w belong|s to the|
|000024c0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 2e 7d 0d 0d | applica|tion.}..|
|000024d0| 42 45 47 49 4e 0d 09 49 | 46 20 77 69 6e 64 6f 77 |BEGIN..I|F window|
|000024e0| 20 3d 20 4e 49 4c 20 54 | 48 45 4e 0d 09 09 49 73 | = NIL T|HEN...Is|
|000024f0| 41 70 70 57 69 6e 64 6f | 77 20 3a 3d 20 46 41 4c |AppWindo|w := FAL|
|00002500| 53 45 0d 09 45 4c 53 45 | 09 7b 61 70 70 6c 69 63 |SE..ELSE|.{applic|
|00002510| 61 74 69 6f 6e 20 77 69 | 6e 64 6f 77 73 20 68 61 |ation wi|ndows ha|
|00002520| 76 65 20 6e 6f 6e 2d 6e | 65 67 61 74 69 76 65 20 |ve non-n|egative |
|00002530| 77 69 6e 64 6f 77 4b 69 | 6e 64 73 7d 0d 09 09 49 |windowKi|nds}...I|
|00002540| 73 41 70 70 57 69 6e 64 | 6f 77 20 3a 3d 20 57 69 |sAppWind|ow := Wi|
|00002550| 6e 64 6f 77 50 65 65 6b | 28 77 69 6e 64 6f 77 29 |ndowPeek|(window)|
|00002560| 5e 2e 77 69 6e 64 6f 77 | 4b 69 6e 64 20 3e 3d 20 |^.window|Kind >= |
|00002570| 30 3b 0d 45 4e 44 3b 20 | 7b 49 73 41 70 70 57 69 |0;.END; |{IsAppWi|
|00002580| 6e 64 6f 77 7d 0d 0d 0d | 7b 24 53 20 4d 61 69 6e |ndow}...|{$S Main|
|00002590| 7d 0d 50 52 4f 43 45 44 | 55 52 45 20 47 65 74 54 |}.PROCED|URE GetT|
|000025a0| 45 52 65 63 74 28 77 69 | 6e 64 6f 77 3a 20 57 69 |ERect(wi|ndow: Wi|
|000025b0| 6e 64 6f 77 50 74 72 3b | 20 56 41 52 20 74 65 52 |ndowPtr;| VAR teR|
|000025c0| 65 63 74 3a 20 52 65 63 | 74 29 3b 0d 0d 7b 72 65 |ect: Rec|t);..{re|
|000025d0| 74 75 72 6e 20 61 20 72 | 65 63 74 61 6e 67 6c 65 |turn a r|ectangle|
|000025e0| 20 74 68 61 74 20 69 73 | 20 69 6e 73 65 74 20 66 | that is| inset f|
|000025f0| 72 6f 6d 20 74 68 65 20 | 70 6f 72 74 52 65 63 74 |rom the |portRect|
|00002600| 20 62 79 20 74 68 65 20 | 73 69 7a 65 20 6f 66 0d | by the |size of.|
|00002610| 74 68 65 20 73 63 72 6f | 6c 6c 62 61 72 73 20 61 |the scro|llbars a|
|00002620| 6e 64 20 61 20 6c 69 74 | 74 6c 65 20 65 78 74 72 |nd a lit|tle extr|
|00002630| 61 20 6d 61 72 67 69 6e | 2e 7d 0d 0d 42 45 47 49 |a margin|.}..BEGI|
|00002640| 4e 0d 09 74 65 52 65 63 | 74 20 3a 3d 20 77 69 6e |N..teRec|t := win|
|00002650| 64 6f 77 5e 2e 70 6f 72 | 74 52 65 63 74 3b 0d 09 |dow^.por|tRect;..|
|00002660| 49 6e 73 65 74 52 65 63 | 74 28 74 65 52 65 63 74 |InsetRec|t(teRect|
|00002670| 2c 20 74 65 78 74 4d 61 | 72 67 69 6e 2c 20 74 65 |, textMa|rgin, te|
|00002680| 78 74 4d 61 72 67 69 6e | 29 3b 09 09 09 7b 61 64 |xtMargin|);...{ad|
|00002690| 6a 75 73 74 20 66 6f 72 | 20 6d 61 72 67 69 6e 7d |just for| margin}|
|000026a0| 0d 09 74 65 52 65 63 74 | 2e 62 6f 74 74 6f 6d 20 |..teRect|.bottom |
|000026b0| 3a 3d 20 74 65 52 65 63 | 74 2e 62 6f 74 74 6f 6d |:= teRec|t.bottom|
|000026c0| 20 2d 20 73 63 72 6f 6c | 6c 62 61 72 41 64 6a 75 | - scrol|lbarAdju|
|000026d0| 73 74 3b 09 7b 61 6e 64 | 20 66 6f 72 20 74 68 65 |st;.{and| for the|
|000026e0| 20 73 63 72 6f 6c 6c 62 | 61 72 73 7d 0d 09 74 65 | scrollb|ars}..te|
|000026f0| 52 65 63 74 2e 72 69 67 | 68 74 20 3a 3d 20 74 65 |Rect.rig|ht := te|
|00002700| 52 65 63 74 2e 72 69 67 | 68 74 20 2d 20 73 63 72 |Rect.rig|ht - scr|
|00002710| 6f 6c 6c 62 61 72 41 64 | 6a 75 73 74 3b 0d 45 4e |ollbarAd|just;.EN|
|00002720| 44 3b 20 7b 47 65 74 54 | 45 52 65 63 74 7d 0d 0d |D; {GetT|ERect}..|
|00002730| 0d 7b 24 53 20 4d 61 69 | 6e 7d 0d 50 52 4f 43 45 |.{$S Mai|n}.PROCE|
|00002740| 44 55 52 45 20 44 6f 43 | 6c 6f 73 65 57 69 6e 64 |DURE DoC|loseWind|
|00002750| 6f 77 28 77 69 6e 64 6f | 77 3a 20 57 69 6e 64 6f |ow(windo|w: Windo|
|00002760| 77 50 74 72 29 3b 0d 0d | 7b 43 6c 6f 73 65 20 61 |wPtr);..|{Close a|
|00002770| 20 77 69 6e 64 6f 77 2e | 20 54 68 69 73 20 68 61 | window.| This ha|
|00002780| 6e 64 6c 65 73 20 64 65 | 73 6b 20 61 63 63 65 73 |ndles de|sk acces|
|00002790| 73 6f 72 79 20 61 6e 64 | 20 61 70 70 6c 69 63 61 |sory and| applica|
|000027a0| 74 69 6f 6e 20 77 69 6e | 64 6f 77 73 2e 7d 0d 0d |tion win|dows.}..|
|000027b0| 42 45 47 49 4e 0d 09 49 | 46 20 49 73 44 41 57 69 |BEGIN..I|F IsDAWi|
|000027c0| 6e 64 6f 77 28 77 69 6e | 64 6f 77 29 20 54 48 45 |ndow(win|dow) THE|
|000027d0| 4e 0d 09 09 43 6c 6f 73 | 65 44 65 73 6b 41 63 63 |N...Clos|eDeskAcc|
|000027e0| 28 57 69 6e 64 6f 77 50 | 65 65 6b 28 77 69 6e 64 |(WindowP|eek(wind|
|000027f0| 6f 77 29 5e 2e 77 69 6e | 64 6f 77 4b 69 6e 64 29 |ow)^.win|dowKind)|
|00002800| 0d 09 45 4c 53 45 20 49 | 46 20 49 73 41 70 70 57 |..ELSE I|F IsAppW|
|00002810| 69 6e 64 6f 77 28 77 69 | 6e 64 6f 77 29 20 54 48 |indow(wi|ndow) TH|
|00002820| 45 4e 20 42 45 47 49 4e | 0d 09 09 57 49 54 48 20 |EN BEGIN|...WITH |
|00002830| 44 6f 63 75 6d 65 6e 74 | 50 65 65 6b 28 77 69 6e |Document|Peek(win|
|00002840| 64 6f 77 29 5e 20 44 4f | 0d 09 09 09 49 46 20 64 |dow)^ DO|....IF d|
|00002850| 6f 63 54 45 20 3c 3e 20 | 4e 49 4c 20 54 48 45 4e |ocTE <> |NIL THEN|
|00002860| 0d 09 09 09 09 54 45 44 | 69 73 70 6f 73 65 28 64 |.....TED|ispose(d|
|00002870| 6f 63 54 45 29 3b 09 09 | 7b 64 69 73 70 6f 73 65 |ocTE);..|{dispose|
|00002880| 20 74 68 65 20 54 45 48 | 61 6e 64 6c 65 7d 0d 09 | the TEH|andle}..|
|00002890| 09 44 69 73 70 6f 73 65 | 57 69 6e 64 6f 77 28 77 |.Dispose|Window(w|
|000028a0| 69 6e 64 6f 77 29 3b 0d | 09 09 67 4e 75 6d 44 6f |indow);.|..gNumDo|
|000028b0| 63 75 6d 65 6e 74 73 20 | 3a 3d 20 67 4e 75 6d 44 |cuments |:= gNumD|
|000028c0| 6f 63 75 6d 65 6e 74 73 | 20 2d 20 31 3b 0d 09 45 |ocuments| - 1;..E|
|000028d0| 4e 44 3b 0d 45 4e 44 3b | 20 7b 44 6f 43 6c 6f 73 |ND;.END;| {DoClos|
|000028e0| 65 57 69 6e 64 6f 77 7d | 0d 0d 0d 7b 24 53 20 4d |eWindow}|...{$S M|
|000028f0| 61 69 6e 7d 0d 50 52 4f | 43 45 44 55 52 45 20 41 |ain}.PRO|CEDURE A|
|00002900| 64 6a 75 73 74 56 69 65 | 77 52 65 63 74 28 64 6f |djustVie|wRect(do|
|00002910| 63 54 45 3a 20 54 45 48 | 61 6e 64 6c 65 29 3b 0d |cTE: TEH|andle);.|
|00002920| 0d 7b 55 70 64 61 74 65 | 20 74 68 65 20 54 45 52 |.{Update| the TER|
|00002930| 65 63 27 73 20 76 69 65 | 77 20 72 65 63 74 20 73 |ec's vie|w rect s|
|00002940| 6f 20 74 68 61 74 20 69 | 74 20 69 73 20 74 68 65 |o that i|t is the|
|00002950| 20 67 72 65 61 74 65 73 | 74 20 6d 75 6c 74 69 70 | greates|t multip|
|00002960| 6c 65 20 6f 66 0d 74 68 | 65 20 6c 69 6e 65 48 65 |le of.th|e lineHe|
|00002970| 69 67 68 74 20 61 6e 64 | 20 73 74 69 6c 6c 20 66 |ight and| still f|
|00002980| 69 74 73 20 69 6e 20 74 | 68 65 20 6f 6c 64 20 76 |its in t|he old v|
|00002990| 69 65 77 52 65 63 74 2e | 7d 0d 0d 42 45 47 49 4e |iewRect.|}..BEGIN|
|000029a0| 0d 09 57 49 54 48 20 64 | 6f 63 54 45 5e 5e 20 44 |..WITH d|ocTE^^ D|
|000029b0| 4f 20 42 45 47 49 4e 0d | 09 09 76 69 65 77 52 65 |O BEGIN.|..viewRe|
|000029c0| 63 74 2e 62 6f 74 74 6f | 6d 20 3a 3d 20 28 28 28 |ct.botto|m := (((|
|000029d0| 76 69 65 77 52 65 63 74 | 2e 62 6f 74 74 6f 6d 20 |viewRect|.bottom |
|000029e0| 2d 20 76 69 65 77 52 65 | 63 74 2e 74 6f 70 29 20 |- viewRe|ct.top) |
|000029f0| 44 49 56 20 6c 69 6e 65 | 48 65 69 67 68 74 29 20 |DIV line|Height) |
|00002a00| 2a 0d 09 09 09 09 09 09 | 09 6c 69 6e 65 48 65 69 |*.......|.lineHei|
|00002a10| 67 68 74 29 20 2b 20 76 | 69 65 77 52 65 63 74 2e |ght) + v|iewRect.|
|00002a20| 74 6f 70 3b 0d 09 45 4e | 44 3b 0d 45 4e 44 3b 20 |top;..EN|D;.END; |
|00002a30| 7b 41 64 6a 75 73 74 56 | 69 65 77 52 65 63 74 7d |{AdjustV|iewRect}|
|00002a40| 0d 0d 0d 7b 24 53 20 4d | 61 69 6e 7d 0d 50 52 4f |...{$S M|ain}.PRO|
|00002a50| 43 45 44 55 52 45 20 41 | 64 6a 75 73 74 54 45 28 |CEDURE A|djustTE(|
|00002a60| 77 69 6e 64 6f 77 3a 20 | 57 69 6e 64 6f 77 50 74 |window: |WindowPt|
|00002a70| 72 29 3b 0d 0d 7b 53 63 | 72 6f 6c 6c 20 74 68 65 |r);..{Sc|roll the|
|00002a80| 20 54 45 52 65 63 20 61 | 72 6f 75 6e 64 20 74 6f | TERec a|round to|
|00002a90| 20 6d 61 74 63 68 20 75 | 70 20 74 6f 20 74 68 65 | match u|p to the|
|00002aa0| 20 70 6f 74 65 6e 74 69 | 61 6c 6c 79 20 75 70 64 | potenti|ally upd|
|00002ab0| 61 74 65 64 20 73 63 72 | 6f 6c 6c 62 61 72 0d 76 |ated scr|ollbar.v|
|00002ac0| 61 6c 75 65 73 2e 20 54 | 68 69 73 20 69 73 20 72 |alues. T|his is r|
|00002ad0| 65 61 6c 6c 79 20 75 73 | 65 66 75 6c 20 77 68 65 |eally us|eful whe|
|00002ae0| 6e 20 74 68 65 20 77 69 | 6e 64 6f 77 20 72 65 73 |n the wi|ndow res|
|00002af0| 69 7a 65 73 20 73 75 63 | 68 20 74 68 61 74 20 74 |izes suc|h that t|
|00002b00| 68 65 0d 73 63 72 6f 6c | 6c 62 61 72 73 20 62 65 |he.scrol|lbars be|
|00002b10| 63 6f 6d 65 20 69 6e 61 | 63 74 69 76 65 20 61 6e |come ina|ctive an|
|00002b20| 64 20 74 68 65 20 54 45 | 52 65 63 20 68 61 64 20 |d the TE|Rec had |
|00002b30| 62 65 65 6e 20 70 72 65 | 76 69 6f 75 73 6c 79 20 |been pre|viously |
|00002b40| 73 63 72 6f 6c 6c 65 64 | 2e 7d 0d 0d 56 41 52 0d |scrolled|.}..VAR.|
|00002b50| 09 76 61 6c 75 65 09 3a | 20 49 4e 54 45 47 45 52 |.value.:| INTEGER|
|00002b60| 3b 0d 42 45 47 49 4e 0d | 09 57 49 54 48 20 44 6f |;.BEGIN.|.WITH Do|
|00002b70| 63 75 6d 65 6e 74 50 65 | 65 6b 28 77 69 6e 64 6f |cumentPe|ek(windo|
|00002b80| 77 29 5e 20 44 4f 20 42 | 45 47 49 4e 0d 09 09 54 |w)^ DO B|EGIN...T|
|00002b90| 45 53 63 72 6f 6c 6c 28 | 28 64 6f 63 54 45 5e 5e |EScroll(|(docTE^^|
|00002ba0| 2e 76 69 65 77 52 65 63 | 74 2e 6c 65 66 74 20 2d |.viewRec|t.left -|
|00002bb0| 20 64 6f 63 54 45 5e 5e | 2e 64 65 73 74 52 65 63 | docTE^^|.destRec|
|00002bc0| 74 2e 6c 65 66 74 29 20 | 2d 20 47 65 74 43 74 6c |t.left) |- GetCtl|
|00002bd0| 56 61 6c 75 65 28 64 6f | 63 48 53 63 72 6f 6c 6c |Value(do|cHScroll|
|00002be0| 29 2c 0d 09 09 09 09 28 | 64 6f 63 54 45 5e 5e 2e |),.....(|docTE^^.|
|00002bf0| 76 69 65 77 52 65 63 74 | 2e 74 6f 70 20 2d 20 64 |viewRect|.top - d|
|00002c00| 6f 63 54 45 5e 5e 2e 64 | 65 73 74 52 65 63 74 2e |ocTE^^.d|estRect.|
|00002c10| 74 6f 70 29 20 2d 0d 09 | 09 09 09 09 28 47 65 74 |top) -..|....(Get|
|00002c20| 43 74 6c 56 61 6c 75 65 | 28 64 6f 63 56 53 63 72 |CtlValue|(docVScr|
|00002c30| 6f 6c 6c 29 20 2a 20 64 | 6f 63 54 45 5e 5e 2e 6c |oll) * d|ocTE^^.l|
|00002c40| 69 6e 65 48 65 69 67 68 | 74 29 2c 0d 09 09 09 09 |ineHeigh|t),.....|
|00002c50| 64 6f 63 54 45 29 3b 0d | 09 45 4e 44 3b 0d 45 4e |docTE);.|.END;.EN|
|00002c60| 44 3b 20 7b 41 64 6a 75 | 73 74 54 45 7d 0d 0d 0d |D; {Adju|stTE}...|
|00002c70| 7b 24 53 20 4d 61 69 6e | 7d 0d 50 52 4f 43 45 44 |{$S Main|}.PROCED|
|00002c80| 55 52 45 20 41 64 6a 75 | 73 74 48 56 28 69 73 56 |URE Adju|stHV(isV|
|00002c90| 65 72 74 3a 20 42 4f 4f | 4c 45 41 4e 3b 20 63 6f |ert: BOO|LEAN; co|
|00002ca0| 6e 74 72 6f 6c 3a 20 43 | 6f 6e 74 72 6f 6c 48 61 |ntrol: C|ontrolHa|
|00002cb0| 6e 64 6c 65 3b 20 64 6f | 63 54 45 3a 20 54 45 48 |ndle; do|cTE: TEH|
|00002cc0| 61 6e 64 6c 65 3b 20 63 | 61 6e 52 65 64 72 61 77 |andle; c|anRedraw|
|00002cd0| 3a 20 42 4f 4f 4c 45 41 | 4e 29 3b 0d 0d 7b 43 61 |: BOOLEA|N);..{Ca|
|00002ce0| 6c 63 75 6c 61 74 65 20 | 74 68 65 20 6e 65 77 20 |lculate |the new |
|00002cf0| 63 6f 6e 74 72 6f 6c 20 | 6d 61 78 69 6d 75 6d 20 |control |maximum |
|00002d00| 76 61 6c 75 65 20 61 6e | 64 20 63 75 72 72 65 6e |value an|d curren|
|00002d10| 74 20 76 61 6c 75 65 2c | 20 77 68 65 74 68 65 72 |t value,| whether|
|00002d20| 20 69 74 20 69 73 20 74 | 68 65 20 68 6f 72 69 7a | it is t|he horiz|
|00002d30| 6f 6e 74 61 6c 20 6f 72 | 0d 76 65 72 74 69 63 61 |ontal or|.vertica|
|00002d40| 6c 20 73 63 72 6f 6c 6c | 62 61 72 2e 20 54 68 65 |l scroll|bar. The|
|00002d50| 20 76 65 72 74 69 63 61 | 6c 20 6d 61 78 20 69 73 | vertica|l max is|
|00002d60| 20 63 61 6c 63 75 6c 61 | 74 65 64 20 62 79 20 63 | calcula|ted by c|
|00002d70| 6f 6d 70 61 72 69 6e 67 | 20 74 68 65 20 6e 75 6d |omparing| the num|
|00002d80| 62 65 72 20 6f 66 20 6c | 69 6e 65 73 20 74 6f 20 |ber of l|ines to |
|00002d90| 74 68 65 0d 76 65 72 74 | 69 63 61 6c 20 73 69 7a |the.vert|ical siz|
|00002da0| 65 20 6f 66 20 74 68 65 | 20 76 69 65 77 52 65 63 |e of the| viewRec|
|00002db0| 74 2e 20 54 68 65 20 68 | 6f 72 69 7a 6f 6e 74 61 |t. The h|orizonta|
|00002dc0| 6c 20 6d 61 78 20 69 73 | 20 63 61 6c 63 75 6c 61 |l max is| calcula|
|00002dd0| 74 65 64 20 62 79 20 63 | 6f 6d 70 61 72 69 6e 67 |ted by c|omparing|
|00002de0| 20 74 68 65 20 6d 61 78 | 69 6d 75 6d 20 64 6f 63 | the max|imum doc|
|00002df0| 75 6d 65 6e 74 0d 77 69 | 64 74 68 20 74 6f 20 74 |ument.wi|dth to t|
|00002e00| 68 65 20 77 69 64 74 68 | 20 6f 66 20 74 68 65 20 |he width| of the |
|00002e10| 76 69 65 77 52 65 63 74 | 2e 20 54 68 65 20 63 75 |viewRect|. The cu|
|00002e20| 72 72 65 6e 74 20 76 61 | 6c 75 65 73 20 61 72 65 |rrent va|lues are|
|00002e30| 20 73 65 74 20 62 79 20 | 63 6f 6d 70 61 72 69 6e | set by |comparin|
|00002e40| 67 20 74 68 65 20 6f 66 | 66 73 65 74 20 62 65 74 |g the of|fset bet|
|00002e50| 77 65 65 6e 0d 74 68 65 | 20 76 69 65 77 20 61 6e |ween.the| view an|
|00002e60| 64 20 64 65 73 74 69 6e | 61 74 69 6f 6e 20 72 65 |d destin|ation re|
|00002e70| 63 74 73 2e 20 49 66 20 | 6e 65 63 65 73 73 61 72 |cts. If |necessar|
|00002e80| 79 20 61 6e 64 20 77 65 | 20 63 61 6e 52 65 64 72 |y and we| canRedr|
|00002e90| 61 77 2c 20 68 61 76 65 | 20 74 68 65 20 63 6f 6e |aw, have| the con|
|00002ea0| 74 72 6f 6c 20 62 65 20 | 72 65 2d 64 72 61 77 6e |trol be |re-drawn|
|00002eb0| 20 62 79 0d 63 61 6c 6c | 69 6e 67 20 53 68 6f 77 | by.call|ing Show|
|00002ec0| 43 6f 6e 74 72 6f 6c 2e | 7d 0d 0d 56 41 52 0d 09 |Control.|}..VAR..|
|00002ed0| 76 61 6c 75 65 2c 20 6c | 69 6e 65 73 2c 20 6d 61 |value, l|ines, ma|
|00002ee0| 78 09 3a 20 49 4e 54 45 | 47 45 52 3b 0d 09 6f 6c |x.: INTE|GER;..ol|
|00002ef0| 64 56 61 6c 75 65 2c 20 | 6f 6c 64 4d 61 78 09 3a |dValue, |oldMax.:|
|00002f00| 20 49 4e 54 45 47 45 52 | 3b 0d 42 45 47 49 4e 0d | INTEGER|;.BEGIN.|
|00002f10| 09 6f 6c 64 56 61 6c 75 | 65 20 3a 3d 20 47 65 74 |.oldValu|e := Get|
|00002f20| 43 74 6c 56 61 6c 75 65 | 28 63 6f 6e 74 72 6f 6c |CtlValue|(control|
|00002f30| 29 3b 0d 09 6f 6c 64 4d | 61 78 20 3a 3d 20 47 65 |);..oldM|ax := Ge|
|00002f40| 74 43 74 6c 4d 61 78 28 | 63 6f 6e 74 72 6f 6c 29 |tCtlMax(|control)|
|00002f50| 3b 0d 09 49 46 20 69 73 | 56 65 72 74 20 54 48 45 |;..IF is|Vert THE|
|00002f60| 4e 20 42 45 47 49 4e 0d | 09 09 6c 69 6e 65 73 20 |N BEGIN.|..lines |
|00002f70| 3a 3d 20 64 6f 63 54 45 | 5e 5e 2e 6e 4c 69 6e 65 |:= docTE|^^.nLine|
|00002f80| 73 3b 0d 09 09 7b 73 69 | 6e 63 65 20 6e 4c 69 6e |s;...{si|nce nLin|
|00002f90| 65 73 20 69 73 6e d5 74 | 20 72 69 67 68 74 20 69 |es isn.t| right i|
|00002fa0| 66 20 74 68 65 20 6c 61 | 73 74 20 63 68 61 72 61 |f the la|st chara|
|00002fb0| 63 74 65 72 20 69 73 20 | 61 20 72 65 74 75 72 6e |cter is |a return|
|00002fc0| 2c 20 63 68 65 63 6b 20 | 66 6f 72 20 74 68 61 74 |, check |for that|
|00002fd0| 20 63 61 73 65 7d 0d 09 | 09 49 46 20 50 74 72 28 | case}..|.IF Ptr(|
|00002fe0| 4f 52 44 28 64 6f 63 54 | 45 5e 5e 2e 68 54 65 78 |ORD(docT|E^^.hTex|
|00002ff0| 74 5e 29 20 2b 20 64 6f | 63 54 45 5e 5e 2e 74 65 |t^) + do|cTE^^.te|
|00003000| 4c 65 6e 67 74 68 20 2d | 20 31 29 5e 20 3d 20 63 |Length -| 1)^ = c|
|00003010| 72 43 68 61 72 61 63 74 | 65 72 20 54 48 45 4e 0d |rCharact|er THEN.|
|00003020| 09 09 09 6c 69 6e 65 73 | 20 3a 3d 20 6c 69 6e 65 |...lines| := line|
|00003030| 73 20 2b 20 31 3b 0d 09 | 09 6d 61 78 20 3a 3d 20 |s + 1;..|.max := |
|00003040| 6c 69 6e 65 73 20 2d 20 | 28 28 64 6f 63 54 45 5e |lines - |((docTE^|
|00003050| 5e 2e 76 69 65 77 52 65 | 63 74 2e 62 6f 74 74 6f |^.viewRe|ct.botto|
|00003060| 6d 20 2d 20 64 6f 63 54 | 45 5e 5e 2e 76 69 65 77 |m - docT|E^^.view|
|00003070| 52 65 63 74 2e 74 6f 70 | 29 20 44 49 56 20 64 6f |Rect.top|) DIV do|
|00003080| 63 54 45 5e 5e 2e 6c 69 | 6e 65 48 65 69 67 68 74 |cTE^^.li|neHeight|
|00003090| 29 3b 0d 09 45 4e 44 20 | 45 4c 53 45 0d 09 09 6d |);..END |ELSE...m|
|000030a0| 61 78 20 3a 3d 20 6d 61 | 78 44 6f 63 57 69 64 74 |ax := ma|xDocWidt|
|000030b0| 68 20 2d 20 28 64 6f 63 | 54 45 5e 5e 2e 76 69 65 |h - (doc|TE^^.vie|
|000030c0| 77 52 65 63 74 2e 72 69 | 67 68 74 20 2d 20 64 6f |wRect.ri|ght - do|
|000030d0| 63 54 45 5e 5e 2e 76 69 | 65 77 52 65 63 74 2e 6c |cTE^^.vi|ewRect.l|
|000030e0| 65 66 74 29 3b 0d 09 49 | 46 20 6d 61 78 20 3c 20 |eft);..I|F max < |
|000030f0| 30 20 54 48 45 4e 20 6d | 61 78 20 3a 3d 20 30 3b |0 THEN m|ax := 0;|
|00003100| 09 09 09 7b 63 68 65 63 | 6b 20 66 6f 72 20 6e 65 |...{chec|k for ne|
|00003110| 67 61 74 69 76 65 20 76 | 61 6c 75 65 73 7d 0d 09 |gative v|alues}..|
|00003120| 53 65 74 43 74 6c 4d 61 | 78 28 63 6f 6e 74 72 6f |SetCtlMa|x(contro|
|00003130| 6c 2c 20 6d 61 78 29 3b | 0d 09 49 46 20 69 73 56 |l, max);|..IF isV|
|00003140| 65 72 74 20 54 48 45 4e | 0d 09 09 76 61 6c 75 65 |ert THEN|...value|
|00003150| 20 3a 3d 20 28 64 6f 63 | 54 45 5e 5e 2e 76 69 65 | := (doc|TE^^.vie|
|00003160| 77 52 65 63 74 2e 74 6f | 70 20 2d 20 64 6f 63 54 |wRect.to|p - docT|
|00003170| 45 5e 5e 2e 64 65 73 74 | 52 65 63 74 2e 74 6f 70 |E^^.dest|Rect.top|
|00003180| 29 20 44 49 56 20 64 6f | 63 54 45 5e 5e 2e 6c 69 |) DIV do|cTE^^.li|
|00003190| 6e 65 48 65 69 67 68 74 | 0d 09 45 4c 53 45 0d 09 |neHeight|..ELSE..|
|000031a0| 09 76 61 6c 75 65 20 3a | 3d 20 64 6f 63 54 45 5e |.value :|= docTE^|
|000031b0| 5e 2e 76 69 65 77 52 65 | 63 74 2e 6c 65 66 74 20 |^.viewRe|ct.left |
|000031c0| 2d 20 64 6f 63 54 45 5e | 5e 2e 64 65 73 74 52 65 |- docTE^|^.destRe|
|000031d0| 63 74 2e 6c 65 66 74 3b | 0d 09 49 46 20 76 61 6c |ct.left;|..IF val|
|000031e0| 75 65 20 3c 20 30 20 54 | 48 45 4e 0d 09 09 76 61 |ue < 0 T|HEN...va|
|000031f0| 6c 75 65 20 3a 3d 20 30 | 0d 09 45 4c 53 45 20 49 |lue := 0|..ELSE I|
|00003200| 46 20 76 61 6c 75 65 20 | 3e 20 6d 61 78 20 54 48 |F value |> max TH|
|00003210| 45 4e 0d 09 09 76 61 6c | 75 65 20 3a 3d 20 6d 61 |EN...val|ue := ma|
|00003220| 78 3b 09 09 09 09 09 7b | 70 69 6e 20 74 68 65 20 |x;.....{|pin the |
|00003230| 76 61 6c 75 65 20 74 6f | 20 77 69 74 68 69 6e 20 |value to| within |
|00003240| 72 61 6e 67 65 7d 0d 09 | 53 65 74 43 74 6c 56 61 |range}..|SetCtlVa|
|00003250| 6c 75 65 28 63 6f 6e 74 | 72 6f 6c 2c 20 76 61 6c |lue(cont|rol, val|
|00003260| 75 65 29 3b 0d 09 49 46 | 20 63 61 6e 52 65 64 72 |ue);..IF| canRedr|
|00003270| 61 77 20 26 20 28 20 28 | 6d 61 78 20 3c 3e 20 6f |aw & ( (|max <> o|
|00003280| 6c 64 4d 61 78 29 20 7c | 20 28 76 61 6c 75 65 20 |ldMax) || (value |
|00003290| 3c 3e 20 6f 6c 64 56 61 | 6c 75 65 29 20 29 20 54 |<> oldVa|lue) ) T|
|000032a0| 48 45 4e 0d 09 09 53 68 | 6f 77 43 6f 6e 74 72 6f |HEN...Sh|owContro|
|000032b0| 6c 28 63 6f 6e 74 72 6f | 6c 29 3b 09 09 09 7b 63 |l(contro|l);...{c|
|000032c0| 68 65 63 6b 20 74 6f 20 | 73 65 65 20 69 66 20 74 |heck to |see if t|
|000032d0| 68 65 20 63 6f 6e 74 72 | 6f 6c 20 63 61 6e 20 62 |he contr|ol can b|
|000032e0| 65 20 72 65 2d 64 72 61 | 77 6e 7d 0d 45 4e 44 3b |e re-dra|wn}.END;|
|000032f0| 20 7b 41 64 6a 75 73 74 | 48 56 7d 0d 0d 0d 7b 24 | {Adjust|HV}...{$|
|00003300| 53 20 4d 61 69 6e 7d 0d | 50 52 4f 43 45 44 55 52 |S Main}.|PROCEDUR|
|00003310| 45 20 41 64 6a 75 73 74 | 53 63 72 6f 6c 6c 56 61 |E Adjust|ScrollVa|
|00003320| 6c 75 65 73 28 77 69 6e | 64 6f 77 3a 20 57 69 6e |lues(win|dow: Win|
|00003330| 64 6f 77 50 74 72 3b 20 | 63 61 6e 52 65 64 72 61 |dowPtr; |canRedra|
|00003340| 77 3a 20 42 4f 4f 4c 45 | 41 4e 29 3b 0d 0d 7b 53 |w: BOOLE|AN);..{S|
|00003350| 69 6d 70 6c 79 20 63 61 | 6c 6c 20 74 68 65 20 63 |imply ca|ll the c|
|00003360| 6f 6d 6d 6f 6e 20 61 64 | 6a 75 73 74 20 72 6f 75 |ommon ad|just rou|
|00003370| 74 69 6e 65 20 66 6f 72 | 20 74 68 65 20 76 65 72 |tine for| the ver|
|00003380| 74 69 63 61 6c 20 61 6e | 64 20 68 6f 72 69 7a 6f |tical an|d horizo|
|00003390| 6e 74 61 6c 20 73 63 72 | 6f 6c 6c 62 61 72 73 2e |ntal scr|ollbars.|
|000033a0| 7d 0d 0d 42 45 47 49 4e | 0d 09 57 49 54 48 20 44 |}..BEGIN|..WITH D|
|000033b0| 6f 63 75 6d 65 6e 74 50 | 65 65 6b 28 77 69 6e 64 |ocumentP|eek(wind|
|000033c0| 6f 77 29 5e 20 44 4f 20 | 42 45 47 49 4e 0d 09 09 |ow)^ DO |BEGIN...|
|000033d0| 41 64 6a 75 73 74 48 56 | 28 54 52 55 45 2c 20 64 |AdjustHV|(TRUE, d|
|000033e0| 6f 63 56 53 63 72 6f 6c | 6c 2c 20 64 6f 63 54 45 |ocVScrol|l, docTE|
|000033f0| 2c 20 63 61 6e 52 65 64 | 72 61 77 29 3b 0d 09 09 |, canRed|raw);...|
|00003400| 41 64 6a 75 73 74 48 56 | 28 46 41 4c 53 45 2c 20 |AdjustHV|(FALSE, |
|00003410| 64 6f 63 48 53 63 72 6f | 6c 6c 2c 20 64 6f 63 54 |docHScro|ll, docT|
|00003420| 45 2c 20 63 61 6e 52 65 | 64 72 61 77 29 3b 0d 09 |E, canRe|draw);..|
|00003430| 45 4e 44 3b 0d 45 4e 44 | 3b 20 7b 41 64 6a 75 73 |END;.END|; {Adjus|
|00003440| 74 53 63 72 6f 6c 6c 56 | 61 6c 75 65 73 7d 0d 0d |tScrollV|alues}..|
|00003450| 0d 7b 24 53 20 4d 61 69 | 6e 7d 0d 50 52 4f 43 45 |.{$S Mai|n}.PROCE|
|00003460| 44 55 52 45 20 41 64 6a | 75 73 74 53 63 72 6f 6c |DURE Adj|ustScrol|
|00003470| 6c 53 69 7a 65 73 28 77 | 69 6e 64 6f 77 3a 20 57 |lSizes(w|indow: W|
|00003480| 69 6e 64 6f 77 50 74 72 | 29 3b 0d 0d 7b 52 65 2d |indowPtr|);..{Re-|
|00003490| 63 61 6c 63 75 6c 61 74 | 65 20 74 68 65 20 70 6f |calculat|e the po|
|000034a0| 73 69 74 69 6f 6e 20 61 | 6e 64 20 73 69 7a 65 20 |sition a|nd size |
|000034b0| 6f 66 20 74 68 65 20 76 | 69 65 77 52 65 63 74 20 |of the v|iewRect |
|000034c0| 61 6e 64 20 74 68 65 20 | 73 63 72 6f 6c 6c 62 61 |and the |scrollba|
|000034d0| 72 73 2e 7d 0d 0d 56 41 | 52 0d 09 74 65 52 65 63 |rs.}..VA|R..teRec|
|000034e0| 74 09 3a 20 52 65 63 74 | 3b 0d 42 45 47 49 4e 0d |t.: Rect|;.BEGIN.|
|000034f0| 09 47 65 74 54 45 52 65 | 63 74 28 77 69 6e 64 6f |.GetTERe|ct(windo|
|00003500| 77 2c 20 74 65 52 65 63 | 74 29 3b 0d 09 57 49 54 |w, teRec|t);..WIT|
|00003510| 48 20 44 6f 63 75 6d 65 | 6e 74 50 65 65 6b 28 77 |H Docume|ntPeek(w|
|00003520| 69 6e 64 6f 77 29 5e 2c | 20 77 69 6e 64 6f 77 5e |indow)^,| window^|
|00003530| 2e 70 6f 72 74 52 65 63 | 74 20 44 4f 20 42 45 47 |.portRec|t DO BEG|
|00003540| 49 4e 0d 09 09 64 6f 63 | 54 45 5e 5e 2e 76 69 65 |IN...doc|TE^^.vie|
|00003550| 77 52 65 63 74 20 3a 3d | 20 74 65 52 65 63 74 3b |wRect :=| teRect;|
|00003560| 0d 09 09 41 64 6a 75 73 | 74 56 69 65 77 52 65 63 |...Adjus|tViewRec|
|00003570| 74 28 64 6f 63 54 45 29 | 3b 0d 09 09 4d 6f 76 65 |t(docTE)|;...Move|
|00003580| 43 6f 6e 74 72 6f 6c 28 | 64 6f 63 56 53 63 72 6f |Control(|docVScro|
|00003590| 6c 6c 2c 20 72 69 67 68 | 74 20 2d 20 73 63 72 6f |ll, righ|t - scro|
|000035a0| 6c 6c 62 61 72 41 64 6a | 75 73 74 2c 20 2d 31 29 |llbarAdj|ust, -1)|
|000035b0| 3b 0d 09 09 53 69 7a 65 | 43 6f 6e 74 72 6f 6c 28 |;...Size|Control(|
|000035c0| 64 6f 63 56 53 63 72 6f | 6c 6c 2c 20 73 63 72 6f |docVScro|ll, scro|
|000035d0| 6c 6c 62 61 72 57 69 64 | 74 68 2c 20 28 62 6f 74 |llbarWid|th, (bot|
|000035e0| 74 6f 6d 20 2d 20 74 6f | 70 29 20 2d 20 67 72 6f |tom - to|p) - gro|
|000035f0| 77 62 6f 78 41 64 6a 75 | 73 74 29 3b 0d 09 09 4d |wboxAdju|st);...M|
|00003600| 6f 76 65 43 6f 6e 74 72 | 6f 6c 28 64 6f 63 48 53 |oveContr|ol(docHS|
|00003610| 63 72 6f 6c 6c 2c 20 2d | 31 2c 20 62 6f 74 74 6f |croll, -|1, botto|
|00003620| 6d 20 2d 20 73 63 72 6f | 6c 6c 62 61 72 41 64 6a |m - scro|llbarAdj|
|00003630| 75 73 74 29 3b 0d 09 09 | 53 69 7a 65 43 6f 6e 74 |ust);...|SizeCont|
|00003640| 72 6f 6c 28 64 6f 63 48 | 53 63 72 6f 6c 6c 2c 20 |rol(docH|Scroll, |
|00003650| 28 72 69 67 68 74 20 2d | 20 6c 65 66 74 29 20 2d |(right -| left) -|
|00003660| 20 67 72 6f 77 62 6f 78 | 41 64 6a 75 73 74 2c 20 | growbox|Adjust, |
|00003670| 73 63 72 6f 6c 6c 62 61 | 72 57 69 64 74 68 29 3b |scrollba|rWidth);|
|00003680| 0d 09 45 4e 44 3b 0d 45 | 4e 44 3b 20 7b 41 64 6a |..END;.E|ND; {Adj|
|00003690| 75 73 74 53 63 72 6f 6c | 6c 53 69 7a 65 73 7d 0d |ustScrol|lSizes}.|
|000036a0| 0d 0d 7b 24 53 20 4d 61 | 69 6e 7d 0d 50 52 4f 43 |..{$S Ma|in}.PROC|
|000036b0| 45 44 55 52 45 20 41 64 | 6a 75 73 74 53 63 72 6f |EDURE Ad|justScro|
|000036c0| 6c 6c 62 61 72 73 28 77 | 69 6e 64 6f 77 3a 20 57 |llbars(w|indow: W|
|000036d0| 69 6e 64 6f 77 50 74 72 | 3b 20 6e 65 65 64 73 52 |indowPtr|; needsR|
|000036e0| 65 73 69 7a 65 3a 20 42 | 4f 4f 4c 45 41 4e 29 3b |esize: B|OOLEAN);|
|000036f0| 0d 0d 7b 54 75 72 6e 20 | 6f 66 66 20 74 68 65 20 |..{Turn |off the |
|00003700| 63 6f 6e 74 72 6f 6c 73 | 20 62 79 20 6a 61 6d 6d |controls| by jamm|
|00003710| 69 6e 67 20 61 20 7a 65 | 72 6f 20 69 6e 74 6f 20 |ing a ze|ro into |
|00003720| 74 68 65 69 72 20 63 6f | 6e 74 72 6c 56 69 73 20 |their co|ntrlVis |
|00003730| 66 69 65 6c 64 73 20 28 | 48 69 64 65 43 6f 6e 74 |fields (|HideCont|
|00003740| 72 6f 6c 20 65 72 61 73 | 65 73 20 74 68 65 6d 0d |rol eras|es them.|
|00003750| 61 6e 64 20 77 65 20 64 | 6f 6e 27 74 20 77 61 6e |and we d|on't wan|
|00003760| 74 20 74 68 61 74 29 2e | 20 49 66 20 74 68 65 20 |t that).| If the |
|00003770| 63 6f 6e 74 72 6f 6c 73 | 20 61 72 65 20 74 6f 20 |controls| are to |
|00003780| 62 65 20 72 65 73 69 7a | 65 64 20 61 73 20 77 65 |be resiz|ed as we|
|00003790| 6c 6c 2c 20 63 61 6c 6c | 20 74 68 65 20 70 72 6f |ll, call| the pro|
|000037a0| 63 65 64 75 72 65 20 74 | 6f 20 64 6f 20 74 68 61 |cedure t|o do tha|
|000037b0| 74 2c 0d 74 68 65 6e 20 | 63 61 6c 6c 20 74 68 65 |t,.then |call the|
|000037c0| 20 70 72 6f 63 65 64 75 | 72 65 20 74 6f 20 61 64 | procedu|re to ad|
|000037d0| 6a 75 73 74 20 74 68 65 | 20 6d 61 78 69 6d 75 6d |just the| maximum|
|000037e0| 20 61 6e 64 20 63 75 72 | 72 65 6e 74 20 76 61 6c | and cur|rent val|
|000037f0| 75 65 73 2e 20 46 69 6e | 61 6c 6c 79 20 72 65 2d |ues. Fin|ally re-|
|00003800| 65 6e 61 62 6c 65 20 74 | 68 65 20 63 6f 6e 74 72 |enable t|he contr|
|00003810| 6f 6c 73 0d 62 79 20 6a | 61 6d 6d 69 6e 67 20 61 |ols.by j|amming a|
|00003820| 20 24 46 46 20 69 6e 20 | 74 68 65 69 72 20 63 6f | $FF in |their co|
|00003830| 6e 74 72 6c 56 69 73 20 | 66 69 65 6c 64 73 2e 7d |ntrlVis |fields.}|
|00003840| 0d 0d 56 41 52 0d 09 6f | 6c 64 4d 61 78 2c 20 6f |..VAR..o|ldMax, o|
|00003850| 6c 64 56 61 6c 09 3a 20 | 49 4e 54 45 47 45 52 3b |ldVal.: |INTEGER;|
|00003860| 0d 42 45 47 49 4e 0d 09 | 57 49 54 48 20 44 6f 63 |.BEGIN..|WITH Doc|
|00003870| 75 6d 65 6e 74 50 65 65 | 6b 28 77 69 6e 64 6f 77 |umentPee|k(window|
|00003880| 29 5e 20 44 4f 20 42 45 | 47 49 4e 0d 09 09 7b 46 |)^ DO BE|GIN...{F|
|00003890| 69 72 73 74 2c 20 74 75 | 72 6e 20 76 69 73 69 62 |irst, tu|rn visib|
|000038a0| 69 6c 69 74 79 20 6f 66 | 20 73 63 72 6f 6c 6c 62 |ility of| scrollb|
|000038b0| 61 72 73 20 6f 66 66 20 | 73 6f 20 77 65 20 77 6f |ars off |so we wo|
|000038c0| 6e d5 74 20 67 65 74 20 | 75 6e 77 61 6e 74 65 64 |n.t get |unwanted|
|000038d0| 20 72 65 64 72 61 77 69 | 6e 67 7d 0d 09 09 64 6f | redrawi|ng}...do|
|000038e0| 63 56 53 63 72 6f 6c 6c | 5e 5e 2e 63 6f 6e 74 72 |cVScroll|^^.contr|
|000038f0| 6c 56 69 73 20 3a 3d 20 | 63 6f 6e 74 72 6f 6c 49 |lVis := |controlI|
|00003900| 6e 76 69 73 69 62 6c 65 | 3b 09 09 7b 74 75 72 6e |nvisible|;..{turn|
|00003910| 20 74 68 65 6d 20 6f 66 | 66 7d 0d 09 09 64 6f 63 | them of|f}...doc|
|00003920| 48 53 63 72 6f 6c 6c 5e | 5e 2e 63 6f 6e 74 72 6c |HScroll^|^.contrl|
|00003930| 56 69 73 20 3a 3d 20 63 | 6f 6e 74 72 6f 6c 49 6e |Vis := c|ontrolIn|
|00003940| 76 69 73 69 62 6c 65 3b | 0d 09 09 49 46 20 6e 65 |visible;|...IF ne|
|00003950| 65 64 73 52 65 73 69 7a | 65 20 54 48 45 4e 09 09 |edsResiz|e THEN..|
|00003960| 09 09 09 09 09 09 7b 6d | 6f 76 65 20 61 6e 64 20 |......{m|ove and |
|00003970| 73 69 7a 65 20 69 66 20 | 6e 65 65 64 65 64 7d 0d |size if |needed}.|
|00003980| 09 09 09 41 64 6a 75 73 | 74 53 63 72 6f 6c 6c 53 |...Adjus|tScrollS|
|00003990| 69 7a 65 73 28 77 69 6e | 64 6f 77 29 3b 0d 09 09 |izes(win|dow);...|
|000039a0| 41 64 6a 75 73 74 53 63 | 72 6f 6c 6c 56 61 6c 75 |AdjustSc|rollValu|
|000039b0| 65 73 28 77 69 6e 64 6f | 77 2c 20 4e 4f 54 20 6e |es(windo|w, NOT n|
|000039c0| 65 65 64 73 52 65 73 69 | 7a 65 29 3b 09 7b 66 6f |eedsResi|ze);.{fo|
|000039d0| 6f 6c 20 77 69 74 68 20 | 6d 61 78 20 61 6e 64 20 |ol with |max and |
|000039e0| 63 75 72 72 65 6e 74 20 | 76 61 6c 75 65 7d 0d 09 |current |value}..|
|000039f0| 09 7b 4e 6f 77 2c 20 72 | 65 73 74 6f 72 65 20 76 |.{Now, r|estore v|
|00003a00| 69 73 69 62 69 6c 69 74 | 79 20 69 6e 20 63 61 73 |isibilit|y in cas|
|00003a10| 65 20 77 65 20 6e 65 76 | 65 72 20 68 61 64 20 74 |e we nev|er had t|
|00003a20| 6f 20 53 68 6f 77 43 6f | 6e 74 72 6f 6c 20 64 75 |o ShowCo|ntrol du|
|00003a30| 72 69 6e 67 20 61 64 6a | 75 73 74 6d 65 6e 74 7d |ring adj|ustment}|
|00003a40| 0d 09 09 64 6f 63 56 53 | 63 72 6f 6c 6c 5e 5e 2e |...docVS|croll^^.|
|00003a50| 63 6f 6e 74 72 6c 56 69 | 73 20 3a 3d 20 63 6f 6e |contrlVi|s := con|
|00003a60| 74 72 6f 6c 56 69 73 69 | 62 6c 65 3b 09 09 7b 74 |trolVisi|ble;..{t|
|00003a70| 75 72 6e 20 74 68 65 6d | 20 6f 6e 7d 0d 09 09 64 |urn them| on}...d|
|00003a80| 6f 63 48 53 63 72 6f 6c | 6c 5e 5e 2e 63 6f 6e 74 |ocHScrol|l^^.cont|
|00003a90| 72 6c 56 69 73 20 3a 3d | 20 63 6f 6e 74 72 6f 6c |rlVis :=| control|
|00003aa0| 56 69 73 69 62 6c 65 3b | 0d 09 45 4e 44 3b 0d 45 |Visible;|..END;.E|
|00003ab0| 4e 44 3b 20 7b 41 64 6a | 75 73 74 53 63 72 6f 6c |ND; {Adj|ustScrol|
|00003ac0| 6c 62 61 72 73 7d 0d 0d | 0d 7b 24 53 20 4d 61 69 |lbars}..|.{$S Mai|
|00003ad0| 6e 7d 0d 7b 24 50 55 53 | 48 7d 20 7b 24 5a 2b 7d |n}.{$PUS|H} {$Z+}|
|00003ae0| 0d 50 52 4f 43 45 44 55 | 52 45 20 50 61 73 63 61 |.PROCEDU|RE Pasca|
|00003af0| 6c 43 6c 69 6b 4c 6f 6f | 70 3b 0d 0d 7b 47 65 74 |lClikLoo|p;..{Get|
|00003b00| 73 20 63 61 6c 6c 65 64 | 20 66 72 6f 6d 20 6f 75 |s called| from ou|
|00003b10| 72 20 61 73 73 65 6d 62 | 6c 79 20 6c 61 6e 67 75 |r assemb|ly langu|
|00003b20| 61 67 65 20 72 6f 75 74 | 69 6e 65 2c 20 41 73 6d |age rout|ine, Asm|
|00003b30| 43 6c 69 6b 4c 6f 6f 70 | 2c 20 77 68 69 63 68 20 |ClikLoop|, which |
|00003b40| 69 73 20 69 6e 0d 20 74 | 75 72 6e 20 63 61 6c 6c |is in. t|urn call|
|00003b50| 65 64 20 62 79 20 74 68 | 65 20 54 45 43 6c 69 63 |ed by th|e TEClic|
|00003b60| 6b 20 74 6f 6f 6c 62 6f | 78 20 72 6f 75 74 69 6e |k toolbo|x routin|
|00003b70| 65 2e 20 53 61 76 65 73 | 20 74 68 65 20 77 69 6e |e. Saves| the win|
|00003b80| 64 6f 77 73 20 63 6c 69 | 70 20 72 65 67 69 6f 6e |dows cli|p region|
|00003b90| 2c 0d 20 73 65 74 73 20 | 69 74 20 74 6f 20 74 68 |,. sets |it to th|
|00003ba0| 65 20 70 6f 72 74 52 65 | 63 74 2c 20 61 64 6a 75 |e portRe|ct, adju|
|00003bb0| 73 74 73 20 74 68 65 20 | 73 63 72 6f 6c 6c 62 61 |sts the |scrollba|
|00003bc0| 72 20 76 61 6c 75 65 73 | 20 74 6f 20 6d 61 74 63 |r values| to matc|
|00003bd0| 68 20 74 68 65 20 54 45 | 20 73 63 72 6f 6c 6c 0d |h the TE| scroll.|
|00003be0| 20 61 6d 6f 75 6e 74 2c | 20 74 68 65 6e 20 72 65 | amount,| then re|
|00003bf0| 73 74 6f 72 65 73 20 74 | 68 65 20 63 6c 69 70 20 |stores t|he clip |
|00003c00| 72 65 67 69 6f 6e 2e 7d | 0d 0d 56 41 52 0d 09 77 |region.}|..VAR..w|
|00003c10| 69 6e 64 6f 77 09 3a 20 | 57 69 6e 64 6f 77 50 74 |indow.: |WindowPt|
|00003c20| 72 3b 0d 09 72 65 67 69 | 6f 6e 09 3a 20 52 67 6e |r;..regi|on.: Rgn|
|00003c30| 48 61 6e 64 6c 65 3b 0d | 42 45 47 49 4e 0d 09 77 |Handle;.|BEGIN..w|
|00003c40| 69 6e 64 6f 77 20 3a 3d | 20 46 72 6f 6e 74 57 69 |indow :=| FrontWi|
|00003c50| 6e 64 6f 77 3b 0d 09 72 | 65 67 69 6f 6e 20 3a 3d |ndow;..r|egion :=|
|00003c60| 20 4e 65 77 52 67 6e 3b | 0d 09 47 65 74 43 6c 69 | NewRgn;|..GetCli|
|00003c70| 70 28 72 65 67 69 6f 6e | 29 3b 09 09 09 09 09 7b |p(region|);.....{|
|00003c80| 73 61 76 65 20 74 68 65 | 20 6f 6c 64 20 63 6c 69 |save the| old cli|
|00003c90| 70 7d 0d 09 43 6c 69 70 | 52 65 63 74 28 77 69 6e |p}..Clip|Rect(win|
|00003ca0| 64 6f 77 5e 2e 70 6f 72 | 74 52 65 63 74 29 3b 09 |dow^.por|tRect);.|
|00003cb0| 09 09 7b 73 65 74 20 74 | 68 65 20 6e 65 77 20 63 |..{set t|he new c|
|00003cc0| 6c 69 70 7d 0d 09 41 64 | 6a 75 73 74 53 63 72 6f |lip}..Ad|justScro|
|00003cd0| 6c 6c 56 61 6c 75 65 73 | 28 77 69 6e 64 6f 77 2c |llValues|(window,|
|00003ce0| 20 54 52 55 45 29 3b 09 | 7b 70 61 73 73 20 54 52 | TRUE);.|{pass TR|
|00003cf0| 55 45 20 66 6f 72 20 63 | 61 6e 52 65 64 72 61 77 |UE for c|anRedraw|
|00003d00| 7d 0d 09 53 65 74 43 6c | 69 70 28 72 65 67 69 6f |}..SetCl|ip(regio|
|00003d10| 6e 29 3b 09 09 09 09 09 | 7b 72 65 73 74 6f 72 65 |n);.....|{restore|
|00003d20| 20 74 68 65 20 6f 6c 64 | 20 63 6c 69 70 7d 0d 09 | the old| clip}..|
|00003d30| 44 69 73 70 6f 73 65 52 | 67 6e 28 72 65 67 69 6f |DisposeR|gn(regio|
|00003d40| 6e 29 3b 0d 45 4e 44 3b | 20 7b 50 61 73 63 61 6c |n);.END;| {Pascal|
|00003d50| 43 6c 69 6b 4c 6f 6f 70 | 7d 0d 7b 24 50 4f 50 7d |ClikLoop|}.{$POP}|
|00003d60| 0d 0d 0d 7b 24 53 20 4d | 61 69 6e 7d 0d 7b 24 50 |...{$S M|ain}.{$P|
|00003d70| 55 53 48 7d 20 7b 24 5a | 2b 7d 0d 46 55 4e 43 54 |USH} {$Z|+}.FUNCT|
|00003d80| 49 4f 4e 20 47 65 74 4f | 6c 64 43 6c 69 6b 4c 6f |ION GetO|ldClikLo|
|00003d90| 6f 70 20 3a 20 50 72 6f | 63 50 74 72 3b 0d 0d 7b |op : Pro|cPtr;..{|
|00003da0| 47 65 74 73 20 63 61 6c | 6c 65 64 20 66 72 6f 6d |Gets cal|led from|
|00003db0| 20 6f 75 72 20 61 73 73 | 65 6d 62 6c 79 20 6c 61 | our ass|embly la|
|00003dc0| 6e 67 75 61 67 65 20 72 | 6f 75 74 69 6e 65 2c 20 |nguage r|outine, |
|00003dd0| 41 73 6d 43 6c 69 6b 4c | 6f 6f 70 2c 20 77 68 69 |AsmClikL|oop, whi|
|00003de0| 63 68 20 69 73 20 69 6e | 0d 74 75 72 6e 20 63 61 |ch is in|.turn ca|
|00003df0| 6c 6c 65 64 20 62 79 20 | 74 68 65 20 54 45 43 6c |lled by |the TECl|
|00003e00| 69 63 6b 20 74 6f 6f 6c | 62 6f 78 20 72 6f 75 74 |ick tool|box rout|
|00003e10| 69 6e 65 2e 20 49 74 20 | 72 65 74 75 72 6e 73 20 |ine. It |returns |
|00003e20| 74 68 65 20 61 64 64 72 | 65 73 73 20 6f 66 20 74 |the addr|ess of t|
|00003e30| 68 65 0d 64 65 66 61 75 | 6c 74 20 63 6c 69 6b 4c |he.defau|lt clikL|
|00003e40| 6f 6f 70 20 72 6f 75 74 | 69 6e 65 20 74 68 61 74 |oop rout|ine that|
|00003e50| 20 77 61 73 20 70 75 74 | 20 69 6e 74 6f 20 74 68 | was put| into th|
|00003e60| 65 20 54 45 52 65 63 20 | 62 79 20 54 45 41 75 74 |e TERec |by TEAut|
|00003e70| 6f 56 69 65 77 20 74 6f | 0d 41 73 6d 43 6c 69 6b |oView to|.AsmClik|
|00003e80| 4c 6f 6f 70 20 73 6f 20 | 74 68 61 74 20 69 74 20 |Loop so |that it |
|00003e90| 63 61 6e 20 63 61 6c 6c | 20 69 74 2e 7d 0d 0d 42 |can call| it.}..B|
|00003ea0| 45 47 49 4e 0d 09 47 65 | 74 4f 6c 64 43 6c 69 6b |EGIN..Ge|tOldClik|
|00003eb0| 4c 6f 6f 70 20 3a 3d 20 | 44 6f 63 75 6d 65 6e 74 |Loop := |Document|
|00003ec0| 50 65 65 6b 28 46 72 6f | 6e 74 57 69 6e 64 6f 77 |Peek(Fro|ntWindow|
|00003ed0| 29 5e 2e 64 6f 63 43 6c | 69 6b 3b 0d 45 4e 44 3b |)^.docCl|ik;.END;|
|00003ee0| 20 7b 47 65 74 4f 6c 64 | 43 6c 69 6b 4c 6f 6f 70 | {GetOld|ClikLoop|
|00003ef0| 7d 0d 7b 24 50 4f 50 7d | 0d 0d 0d 50 52 4f 43 45 |}.{$POP}|...PROCE|
|00003f00| 44 55 52 45 20 41 73 6d | 43 6c 69 6b 4c 6f 6f 70 |DURE Asm|ClikLoop|
|00003f10| 3b 20 45 58 54 45 52 4e | 41 4c 3b 0d 0d 7b 41 20 |; EXTERN|AL;..{A |
|00003f20| 72 65 66 65 72 65 6e 63 | 65 20 74 6f 20 6f 75 72 |referenc|e to our|
|00003f30| 20 61 73 73 65 6d 62 6c | 79 20 6c 61 6e 67 75 61 | assembl|y langua|
|00003f40| 67 65 20 72 6f 75 74 69 | 6e 65 20 74 68 61 74 20 |ge routi|ne that |
|00003f50| 67 65 74 73 20 61 74 74 | 61 63 68 65 64 20 74 6f |gets att|ached to|
|00003f60| 20 74 68 65 20 63 6c 69 | 6b 4c 6f 6f 70 0d 66 69 | the cli|kLoop.fi|
|00003f70| 65 6c 64 20 6f 66 20 6f | 75 72 20 54 45 20 72 65 |eld of o|ur TE re|
|00003f80| 63 6f 72 64 2e 7d 0d 0d | 0d 7b 24 53 20 4d 61 69 |cord.}..|.{$S Mai|
|00003f90| 6e 7d 0d 50 52 4f 43 45 | 44 55 52 45 20 44 6f 4e |n}.PROCE|DURE DoN|
|00003fa0| 65 77 3b 0d 0d 7b 43 72 | 65 61 74 65 20 61 20 6e |ew;..{Cr|eate a n|
|00003fb0| 65 77 20 64 6f 63 75 6d | 65 6e 74 20 61 6e 64 20 |ew docum|ent and |
|00003fc0| 77 69 6e 64 6f 77 2e 7d | 0d 0d 56 41 52 0d 09 67 |window.}|..VAR..g|
|00003fd0| 6f 6f 64 09 09 09 09 3a | 20 42 4f 4f 4c 45 41 4e |ood....:| BOOLEAN|
|00003fe0| 3b 0d 09 73 74 6f 72 61 | 67 65 09 09 09 09 3a 20 |;..stora|ge....: |
|00003ff0| 50 74 72 3b 0d 09 77 69 | 6e 64 6f 77 09 09 09 09 |Ptr;..wi|ndow....|
|00004000| 3a 20 57 69 6e 64 6f 77 | 50 74 72 3b 0d 09 64 65 |: Window|Ptr;..de|
|00004010| 73 74 52 65 63 74 2c 20 | 76 69 65 77 52 65 63 74 |stRect, |viewRect|
|00004020| 09 3a 20 52 65 63 74 3b | 0d 0d 42 45 47 49 4e 0d |.: Rect;|..BEGIN.|
|00004030| 09 73 74 6f 72 61 67 65 | 20 3a 3d 20 4e 65 77 50 |.storage| := NewP|
|00004040| 74 72 28 53 49 5a 45 4f | 46 28 44 6f 63 75 6d 65 |tr(SIZEO|F(Docume|
|00004050| 6e 74 52 65 63 6f 72 64 | 29 29 3b 0d 09 49 46 20 |ntRecord|));..IF |
|00004060| 73 74 6f 72 61 67 65 20 | 3c 3e 20 4e 49 4c 20 54 |storage |<> NIL T|
|00004070| 48 45 4e 20 42 45 47 49 | 4e 0d 09 09 77 69 6e 64 |HEN BEGI|N...wind|
|00004080| 6f 77 20 3a 3d 20 47 65 | 74 4e 65 77 57 69 6e 64 |ow := Ge|tNewWind|
|00004090| 6f 77 28 72 44 6f 63 57 | 69 6e 64 6f 77 2c 20 73 |ow(rDocW|indow, s|
|000040a0| 74 6f 72 61 67 65 2c 20 | 57 69 6e 64 6f 77 50 74 |torage, |WindowPt|
|000040b0| 72 28 2d 31 29 29 3b 0d | 09 09 49 46 20 77 69 6e |r(-1));.|..IF win|
|000040c0| 64 6f 77 20 3c 3e 20 4e | 49 4c 20 54 48 45 4e 20 |dow <> N|IL THEN |
|000040d0| 42 45 47 49 4e 0d 09 09 | 09 67 4e 75 6d 44 6f 63 |BEGIN...|.gNumDoc|
|000040e0| 75 6d 65 6e 74 73 20 3a | 3d 20 67 4e 75 6d 44 6f |uments :|= gNumDo|
|000040f0| 63 75 6d 65 6e 74 73 20 | 2b 20 31 3b 09 7b 74 68 |cuments |+ 1;.{th|
|00004100| 69 73 20 77 69 6c 6c 20 | 62 65 20 64 65 63 72 65 |is will |be decre|
|00004110| 6d 65 6e 74 65 64 20 77 | 68 65 6e 20 77 65 20 63 |mented w|hen we c|
|00004120| 61 6c 6c 20 44 6f 43 6c | 6f 73 65 57 69 6e 64 6f |all DoCl|oseWindo|
|00004130| 77 7d 0d 09 09 09 67 6f | 6f 64 20 3a 3d 20 46 41 |w}....go|od := FA|
|00004140| 4c 53 45 3b 0d 09 09 09 | 53 65 74 50 6f 72 74 28 |LSE;....|SetPort(|
|00004150| 77 69 6e 64 6f 77 29 3b | 0d 09 09 09 57 49 54 48 |window);|....WITH|
|00004160| 20 77 69 6e 64 6f 77 5e | 2c 20 44 6f 63 75 6d 65 | window^|, Docume|
|00004170| 6e 74 50 65 65 6b 28 77 | 69 6e 64 6f 77 29 5e 20 |ntPeek(w|indow)^ |
|00004180| 44 4f 20 42 45 47 49 4e | 0d 09 09 09 09 47 65 74 |DO BEGIN|.....Get|
|00004190| 54 45 52 65 63 74 28 77 | 69 6e 64 6f 77 2c 20 76 |TERect(w|indow, v|
|000041a0| 69 65 77 52 65 63 74 29 | 3b 0d 09 09 09 09 64 65 |iewRect)|;.....de|
|000041b0| 73 74 52 65 63 74 20 3a | 3d 20 76 69 65 77 52 65 |stRect :|= viewRe|
|000041c0| 63 74 3b 0d 09 09 09 09 | 64 65 73 74 52 65 63 74 |ct;.....|destRect|
|000041d0| 2e 72 69 67 68 74 20 3a | 3d 20 64 65 73 74 52 65 |.right :|= destRe|
|000041e0| 63 74 2e 6c 65 66 74 20 | 2b 20 6d 61 78 44 6f 63 |ct.left |+ maxDoc|
|000041f0| 57 69 64 74 68 3b 0d 09 | 09 09 09 64 6f 63 54 45 |Width;..|...docTE|
|00004200| 20 3a 3d 20 54 45 4e 65 | 77 28 64 65 73 74 52 65 | := TENe|w(destRe|
|00004210| 63 74 2c 20 76 69 65 77 | 52 65 63 74 29 3b 0d 09 |ct, view|Rect);..|
|00004220| 09 09 09 41 64 6a 75 73 | 74 56 69 65 77 52 65 63 |...Adjus|tViewRec|
|00004230| 74 28 64 6f 63 54 45 29 | 3b 0d 09 09 09 09 54 45 |t(docTE)|;.....TE|
|00004240| 41 75 74 6f 56 69 65 77 | 28 54 52 55 45 2c 20 64 |AutoView|(TRUE, d|
|00004250| 6f 63 54 45 29 3b 0d 09 | 09 09 09 64 6f 63 43 6c |ocTE);..|...docCl|
|00004260| 69 6b 20 3a 3d 20 64 6f | 63 54 45 5e 5e 2e 63 6c |ik := do|cTE^^.cl|
|00004270| 69 6b 4c 6f 6f 70 3b 0d | 09 09 09 09 64 6f 63 54 |ikLoop;.|....docT|
|00004280| 45 5e 5e 2e 63 6c 69 6b | 4c 6f 6f 70 20 3a 3d 20 |E^^.clik|Loop := |
|00004290| 40 41 73 6d 43 6c 69 6b | 4c 6f 6f 70 3b 0d 09 09 |@AsmClik|Loop;...|
|000042a0| 09 09 49 46 20 64 6f 63 | 54 45 20 3c 3e 20 4e 49 |..IF doc|TE <> NI|
|000042b0| 4c 20 54 48 45 4e 0d 09 | 09 09 09 09 67 6f 6f 64 |L THEN..|....good|
|000042c0| 20 3a 3d 20 54 52 55 45 | 3b 09 09 09 09 7b 69 66 | := TRUE|;....{if|
|000042d0| 20 54 45 4e 65 77 20 73 | 75 63 63 65 65 64 65 64 | TENew s|ucceeded|
|000042e0| 2c 20 77 65 20 68 61 76 | 65 20 61 20 67 6f 6f 64 |, we hav|e a good|
|000042f0| 20 64 6f 63 75 6d 65 6e | 74 7d 0d 09 09 09 09 49 | documen|t}.....I|
|00004300| 46 20 67 6f 6f 64 20 54 | 48 45 4e 20 42 45 47 49 |F good T|HEN BEGI|
|00004310| 4e 0d 09 09 09 09 09 64 | 6f 63 56 53 63 72 6f 6c |N......d|ocVScrol|
|00004320| 6c 20 3a 3d 20 47 65 74 | 4e 65 77 43 6f 6e 74 72 |l := Get|NewContr|
|00004330| 6f 6c 28 72 56 53 63 72 | 6f 6c 6c 2c 20 77 69 6e |ol(rVScr|oll, win|
|00004340| 64 6f 77 29 3b 0d 09 09 | 09 09 09 67 6f 6f 64 20 |dow);...|...good |
|00004350| 3a 3d 20 28 64 6f 63 56 | 53 63 72 6f 6c 6c 20 3c |:= (docV|Scroll <|
|00004360| 3e 20 4e 49 4c 29 3b 0d | 09 09 09 09 45 4e 44 3b |> NIL);.|....END;|
|00004370| 0d 09 09 09 09 49 46 20 | 67 6f 6f 64 20 54 48 45 |.....IF |good THE|
|00004380| 4e 20 42 45 47 49 4e 0d | 09 09 09 09 09 64 6f 63 |N BEGIN.|.....doc|
|00004390| 48 53 63 72 6f 6c 6c 20 | 3a 3d 20 47 65 74 4e 65 |HScroll |:= GetNe|
|000043a0| 77 43 6f 6e 74 72 6f 6c | 28 72 48 53 63 72 6f 6c |wControl|(rHScrol|
|000043b0| 6c 2c 20 77 69 6e 64 6f | 77 29 3b 0d 09 09 09 09 |l, windo|w);.....|
|000043c0| 09 67 6f 6f 64 20 3a 3d | 20 28 64 6f 63 48 53 63 |.good :=| (docHSc|
|000043d0| 72 6f 6c 6c 20 3c 3e 20 | 4e 49 4c 29 3b 0d 09 09 |roll <> |NIL);...|
|000043e0| 09 09 45 4e 44 3b 0d 09 | 09 09 09 49 46 20 67 6f |..END;..|...IF go|
|000043f0| 6f 64 20 54 48 45 4e 20 | 42 45 47 49 4e 0d 09 09 |od THEN |BEGIN...|
|00004400| 09 09 09 7b 46 41 4c 53 | 45 20 74 6f 20 41 64 6a |...{FALS|E to Adj|
|00004410| 75 73 74 53 63 72 6f 6c | 6c 56 61 6c 75 65 73 20 |ustScrol|lValues |
|00004420| 6d 65 61 6e 73 20 6d 75 | 73 6e d5 74 20 72 65 64 |means mu|sn.t red|
|00004430| 72 61 77 3b 20 74 65 63 | 68 6e 69 63 61 6c 6c 79 |raw; tec|hnically|
|00004440| 2c 20 6f 66 20 63 6f 75 | 72 73 65 2c 0d 09 09 09 |, of cou|rse,....|
|00004450| 09 09 74 68 65 20 77 69 | 6e 64 6f 77 20 69 73 20 |..the wi|ndow is |
|00004460| 68 69 64 64 65 6e 20 73 | 6f 20 69 74 20 77 6f 75 |hidden s|o it wou|
|00004470| 6c 64 6e d5 74 20 6d 61 | 74 74 65 72 20 77 68 65 |ldn.t ma|tter whe|
|00004480| 74 68 65 72 20 77 65 20 | 63 61 6c 6c 65 64 20 53 |ther we |called S|
|00004490| 68 6f 77 43 6f 6e 74 72 | 6f 6c 20 6f 72 20 6e 6f |howContr|ol or no|
|000044a0| 74 2e 7d 0d 09 09 09 09 | 09 41 64 6a 75 73 74 53 |t.}.....|.AdjustS|
|000044b0| 63 72 6f 6c 6c 56 61 6c | 75 65 73 28 77 69 6e 64 |crollVal|ues(wind|
|000044c0| 6f 77 2c 20 46 41 4c 53 | 45 29 3b 0d 09 09 09 09 |ow, FALS|E);.....|
|000044d0| 09 53 68 6f 77 57 69 6e | 64 6f 77 28 77 69 6e 64 |.ShowWin|dow(wind|
|000044e0| 6f 77 29 3b 09 09 09 7b | 69 66 20 74 68 65 20 64 |ow);...{|if the d|
|000044f0| 6f 63 75 6d 65 6e 74 20 | 69 73 20 67 6f 6f 64 2c |ocument |is good,|
|00004500| 20 6d 61 6b 65 20 74 68 | 65 20 77 69 6e 64 6f 77 | make th|e window|
|00004510| 20 76 69 73 69 62 6c 65 | 7d 0d 09 09 09 09 45 4e | visible|}.....EN|
|00004520| 44 20 45 4c 53 45 20 42 | 45 47 49 4e 0d 09 09 09 |D ELSE B|EGIN....|
|00004530| 09 09 44 6f 43 6c 6f 73 | 65 57 69 6e 64 6f 77 28 |..DoClos|eWindow(|
|00004540| 77 69 6e 64 6f 77 29 3b | 09 09 7b 6f 74 68 65 72 |window);|..{other|
|00004550| 77 69 73 65 20 72 65 67 | 72 65 74 20 77 65 20 65 |wise reg|ret we e|
|00004560| 76 65 72 20 63 72 65 61 | 74 65 64 20 69 74 2e 2e |ver crea|ted it..|
|00004570| 2e 7d 0d 09 09 09 09 09 | 53 79 73 42 65 65 70 28 |.}......|SysBeep(|
|00004580| 38 29 3b 09 09 09 09 09 | 7b 61 6e 64 20 62 65 65 |8);.....|{and bee|
|00004590| 70 20 28 38 20 69 73 20 | 61 6e 20 61 72 62 69 74 |p (8 is |an arbit|
|000045a0| 72 61 72 79 20 64 75 72 | 61 74 69 6f 6e 29 7d 0d |rary dur|ation)}.|
|000045b0| 09 09 09 09 45 4e 44 0d | 09 09 09 45 4e 44 3b 0d |....END.|...END;.|
|000045c0| 09 09 45 4e 44 20 45 4c | 53 45 0d 09 09 09 44 69 |..END EL|SE....Di|
|000045d0| 73 70 6f 73 50 74 72 28 | 73 74 6f 72 61 67 65 29 |sposPtr(|storage)|
|000045e0| 3b 09 09 09 09 09 7b 67 | 65 74 20 72 69 64 20 6f |;.....{g|et rid o|
|000045f0| 66 20 74 68 65 20 73 74 | 6f 72 61 67 65 20 69 66 |f the st|orage if|
|00004600| 20 69 74 20 69 73 20 6e | 65 76 65 72 20 75 73 65 | it is n|ever use|
|00004610| 64 7d 0d 09 45 4e 44 3b | 0d 45 4e 44 3b 20 7b 44 |d}..END;|.END; {D|
|00004620| 6f 4e 65 77 7d 0d 0d 0d | 7b 24 53 20 4d 61 69 6e |oNew}...|{$S Main|
|00004630| 7d 0d 50 52 4f 43 45 44 | 55 52 45 20 46 6f 72 63 |}.PROCED|URE Forc|
|00004640| 65 45 6e 76 69 72 6f 6e | 73 3b 0d 0d 7b 4d 61 6b |eEnviron|s;..{Mak|
|00004650| 65 20 73 75 72 65 20 74 | 68 61 74 20 74 68 65 20 |e sure t|hat the |
|00004660| 6d 61 63 68 69 6e 65 20 | 68 61 73 20 61 74 20 6c |machine |has at l|
|00004670| 65 61 73 74 20 31 32 38 | 4b 20 52 4f 4d 73 20 61 |east 128|K ROMs a|
|00004680| 6e 64 20 65 6e 6f 75 67 | 68 20 6d 65 6d 6f 72 79 |nd enoug|h memory|
|00004690| 20 74 6f 20 72 75 6e 2e | 0d 49 66 20 69 74 20 64 | to run.|.If it d|
|000046a0| 6f 65 73 6e 27 74 2c 20 | 65 78 69 74 2e 7d 0d 0d |oesn't, |exit.}..|
|000046b0| 56 41 52 0d 09 69 67 6e | 6f 72 65 45 72 72 6f 72 |VAR..ign|oreError|
|000046c0| 09 3a 20 4f 53 45 72 72 | 3b 0d 42 45 47 49 4e 0d |.: OSErr|;.BEGIN.|
|000046d0| 09 7b 69 67 6e 6f 72 65 | 20 74 68 65 20 65 72 72 |.{ignore| the err|
|000046e0| 6f 72 20 72 65 74 75 72 | 6e 65 64 20 66 72 6f 6d |or retur|ned from|
|000046f0| 20 53 79 73 45 6e 76 69 | 72 6f 6e 73 3b 20 65 76 | SysEnvi|rons; ev|
|00004700| 65 6e 20 69 66 20 61 6e | 20 65 72 72 6f 72 20 6f |en if an| error o|
|00004710| 63 63 75 72 72 65 64 2c | 0d 09 20 74 68 65 20 53 |ccurred,|.. the S|
|00004720| 79 73 45 6e 76 69 72 6f | 6e 73 20 67 6c 75 65 20 |ysEnviro|ns glue |
|00004730| 77 69 6c 6c 20 66 69 6c | 6c 20 69 6e 20 74 68 65 |will fil|l in the|
|00004740| 20 53 79 73 45 6e 76 52 | 65 63 7d 0d 09 69 67 6e | SysEnvR|ec}..ign|
|00004750| 6f 72 65 45 72 72 6f 72 | 20 3a 3d 20 53 79 73 45 |oreError| := SysE|
|00004760| 6e 76 69 72 6f 6e 73 28 | 73 79 73 45 6e 76 69 72 |nvirons(|sysEnvir|
|00004770| 6f 6e 73 56 65 72 73 69 | 6f 6e 2c 20 67 4d 61 63 |onsVersi|on, gMac|
|00004780| 29 3b 0d 09 49 46 20 28 | 67 4d 61 63 2e 6d 61 63 |);..IF (|gMac.mac|
|00004790| 68 69 6e 65 54 79 70 65 | 20 3c 20 30 29 20 7c 0d |hineType| < 0) |.|
|000047a0| 09 09 28 53 74 61 63 6b | 53 70 61 63 65 20 2b 20 |..(Stack|Space + |
|000047b0| 4f 52 44 28 47 65 74 41 | 70 70 6c 4c 69 6d 69 74 |ORD(GetA|pplLimit|
|000047c0| 29 20 2d 20 4f 52 44 28 | 41 70 70 6c 69 63 5a 6f |) - ORD(|ApplicZo|
|000047d0| 6e 65 29 20 3c 20 6b 4d | 69 6e 53 69 7a 65 20 2a |ne) < kM|inSize *|
|000047e0| 20 31 30 32 34 29 20 54 | 48 45 4e 0d 09 09 45 78 | 1024) T|HEN...Ex|
|000047f0| 69 74 54 6f 53 68 65 6c | 6c 3b 0d 09 7b 69 66 20 |itToShel|l;..{if |
|00004800| 79 6f 75 20 68 61 76 65 | 20 73 74 61 63 6b 20 72 |you have| stack r|
|00004810| 65 71 75 69 72 65 6d 65 | 6e 74 73 20 74 68 61 74 |equireme|nts that|
|00004820| 20 64 69 66 66 65 72 20 | 66 72 6f 6d 20 74 68 65 | differ |from the|
|00004830| 20 64 65 66 61 75 6c 74 | 2c 0d 09 74 68 65 6e 20 | default|,..then |
|00004840| 79 6f 75 20 63 6f 75 6c | 64 20 75 73 65 20 53 65 |you coul|d use Se|
|00004850| 74 41 70 70 6c 4c 69 6d | 69 74 20 74 6f 20 69 6e |tApplLim|it to in|
|00004860| 63 72 65 61 73 65 20 53 | 74 61 63 6b 53 70 61 63 |crease S|tackSpac|
|00004870| 65 20 61 74 20 74 68 69 | 73 20 70 6f 69 6e 74 2e |e at thi|s point.|
|00004880| 7d 0d 45 4e 44 3b 20 7b | 46 6f 72 63 65 45 6e 76 |}.END; {|ForceEnv|
|00004890| 69 72 6f 6e 73 7d 0d 0d | 0d 7b 24 53 20 49 6e 69 |irons}..|.{$S Ini|
|000048a0| 74 69 61 6c 69 7a 65 7d | 0d 50 52 4f 43 45 44 55 |tialize}|.PROCEDU|
|000048b0| 52 45 20 49 6e 69 74 69 | 61 6c 69 7a 65 3b 0d 0d |RE Initi|alize;..|
|000048c0| 7b 53 65 74 20 75 70 20 | 74 68 65 20 77 68 6f 6c |{Set up |the whol|
|000048d0| 65 20 77 6f 72 6c 64 2c | 20 69 6e 63 6c 75 64 69 |e world,| includi|
|000048e0| 6e 67 20 67 6c 6f 62 61 | 6c 20 76 61 72 69 61 62 |ng globa|l variab|
|000048f0| 6c 65 73 2c 20 54 6f 6f | 6c 62 6f 78 20 6d 61 6e |les, Too|lbox man|
|00004900| 61 67 65 72 73 2c 0d 20 | 6d 65 6e 75 73 2c 20 61 |agers,. |menus, a|
|00004910| 6e 64 20 61 20 73 69 6e | 67 6c 65 20 62 6c 61 6e |nd a sin|gle blan|
|00004920| 6b 20 64 6f 63 75 6d 65 | 6e 74 2e 7d 0d 0d 56 41 |k docume|nt.}..VA|
|00004930| 52 0d 09 6d 65 6e 75 42 | 61 72 09 09 3a 20 48 61 |R..menuB|ar..: Ha|
|00004940| 6e 64 6c 65 3b 0d 0d 42 | 45 47 49 4e 0d 09 67 48 |ndle;..B|EGIN..gH|
|00004950| 61 73 57 61 69 74 4e 65 | 78 74 45 76 65 6e 74 20 |asWaitNe|xtEvent |
|00004960| 3a 3d 20 54 72 61 70 41 | 76 61 69 6c 61 62 6c 65 |:= TrapA|vailable|
|00004970| 28 5f 57 61 69 74 4e 65 | 78 74 45 76 65 6e 74 2c |(_WaitNe|xtEvent,|
|00004980| 20 54 6f 6f 6c 54 72 61 | 70 29 3b 0d 09 67 49 6e | ToolTra|p);..gIn|
|00004990| 42 61 63 6b 67 72 6f 75 | 6e 64 20 3a 3d 20 46 41 |Backgrou|nd := FA|
|000049a0| 4c 53 45 3b 0d 0d 09 49 | 6e 69 74 47 72 61 66 28 |LSE;...I|nitGraf(|
|000049b0| 40 74 68 65 50 6f 72 74 | 29 3b 0d 09 49 6e 69 74 |@thePort|);..Init|
|000049c0| 46 6f 6e 74 73 3b 0d 09 | 49 6e 69 74 57 69 6e 64 |Fonts;..|InitWind|
|000049d0| 6f 77 73 3b 0d 09 49 6e | 69 74 4d 65 6e 75 73 3b |ows;..In|itMenus;|
|000049e0| 0d 09 54 45 49 6e 69 74 | 3b 0d 09 49 6e 69 74 44 |..TEInit|;..InitD|
|000049f0| 69 61 6c 6f 67 73 28 4e | 49 4c 29 3b 0d 09 49 6e |ialogs(N|IL);..In|
|00004a00| 69 74 43 75 72 73 6f 72 | 3b 0d 0d 09 6d 65 6e 75 |itCursor|;...menu|
|00004a10| 42 61 72 20 3a 3d 20 47 | 65 74 4e 65 77 4d 42 61 |Bar := G|etNewMBa|
|00004a20| 72 28 72 4d 65 6e 75 42 | 61 72 29 3b 09 09 7b 72 |r(rMenuB|ar);..{r|
|00004a30| 65 61 64 20 6d 65 6e 75 | 73 20 69 6e 74 6f 20 6d |ead menu|s into m|
|00004a40| 65 6e 75 20 62 61 72 7d | 0d 09 49 46 20 6d 65 6e |enu bar}|..IF men|
|00004a50| 75 42 61 72 20 3d 20 4e | 49 4c 20 54 48 45 4e 20 |uBar = N|IL THEN |
|00004a60| 45 78 69 74 54 6f 53 68 | 65 6c 6c 3b 0d 09 53 65 |ExitToSh|ell;..Se|
|00004a70| 74 4d 65 6e 75 42 61 72 | 28 6d 65 6e 75 42 61 72 |tMenuBar|(menuBar|
|00004a80| 29 3b 09 09 09 09 09 7b | 69 6e 73 74 61 6c 6c 20 |);.....{|install |
|00004a90| 6d 65 6e 75 73 7d 0d 09 | 44 69 73 70 6f 73 48 61 |menus}..|DisposHa|
|00004aa0| 6e 64 6c 65 28 6d 65 6e | 75 42 61 72 29 3b 0d 09 |ndle(men|uBar);..|
|00004ab0| 41 64 64 52 65 73 4d 65 | 6e 75 28 47 65 74 4d 48 |AddResMe|nu(GetMH|
|00004ac0| 61 6e 64 6c 65 28 6d 41 | 70 70 6c 65 29 2c 20 27 |andle(mA|pple), '|
|00004ad0| 44 52 56 52 27 29 3b 09 | 7b 61 64 64 20 44 41 20 |DRVR');.|{add DA |
|00004ae0| 6e 61 6d 65 73 20 74 6f | 20 41 70 70 6c 65 20 6d |names to| Apple m|
|00004af0| 65 6e 75 7d 0d 09 44 72 | 61 77 4d 65 6e 75 42 61 |enu}..Dr|awMenuBa|
|00004b00| 72 3b 0d 0d 09 67 4e 75 | 6d 44 6f 63 75 6d 65 6e |r;...gNu|mDocumen|
|00004b10| 74 73 20 3a 3d 20 30 3b | 0d 0d 09 7b 64 6f 20 6f |ts := 0;|...{do o|
|00004b20| 74 68 65 72 20 69 6e 69 | 74 69 61 6c 69 7a 61 74 |ther ini|tializat|
|00004b30| 69 6f 6e 20 68 65 72 65 | 7d 0d 0d 09 44 6f 4e 65 |ion here|}...DoNe|
|00004b40| 77 3b 09 09 09 09 09 09 | 09 09 09 7b 63 72 65 61 |w;......|...{crea|
|00004b50| 74 65 20 61 20 73 69 6e | 67 6c 65 20 65 6d 70 74 |te a sin|gle empt|
|00004b60| 79 20 64 6f 63 75 6d 65 | 6e 74 7d 0d 45 4e 44 3b |y docume|nt}.END;|
|00004b70| 20 7b 49 6e 69 74 69 61 | 6c 69 7a 65 7d 0d 0d 0d | {Initia|lize}...|
|00004b80| 7b 24 53 20 4d 61 69 6e | 7d 0d 50 52 4f 43 45 44 |{$S Main|}.PROCED|
|00004b90| 55 52 45 20 44 6f 43 6c | 6f 73 65 42 65 68 69 6e |URE DoCl|oseBehin|
|00004ba0| 64 28 77 69 6e 64 6f 77 | 3a 20 57 69 6e 64 6f 77 |d(window|: Window|
|00004bb0| 50 74 72 29 3b 0d 0d 7b | 43 6c 6f 73 65 20 74 68 |Ptr);..{|Close th|
|00004bc0| 65 20 77 69 6e 64 6f 77 | 20 74 68 61 74 20 69 73 |e window| that is|
|00004bd0| 20 70 61 73 73 65 64 20 | 61 6e 64 20 61 6c 6c 20 | passed |and all |
|00004be0| 77 69 6e 64 6f 77 73 20 | 62 65 68 69 6e 64 20 69 |windows |behind i|
|00004bf0| 74 2e 0d 20 54 68 69 73 | 20 63 6c 6f 73 65 73 20 |t.. This| closes |
|00004c00| 77 69 6e 64 6f 77 73 20 | 66 72 6f 6d 20 62 61 63 |windows |from bac|
|00004c10| 6b 20 74 6f 20 66 72 6f | 6e 74 2c 20 62 79 20 63 |k to fro|nt, by c|
|00004c20| 61 6c 6c 69 6e 67 20 69 | 74 73 65 6c 66 0d 20 72 |alling i|tself. r|
|00004c30| 65 63 75 72 73 69 76 65 | 6c 79 2c 20 77 68 69 63 |ecursive|ly, whic|
|00004c40| 68 20 6d 69 6e 69 6d 69 | 7a 65 73 20 77 69 6e 64 |h minimi|zes wind|
|00004c50| 6f 77 20 75 70 64 61 74 | 69 6e 67 2e 7d 0d 0d 42 |ow updat|ing.}..B|
|00004c60| 45 47 49 4e 0d 09 49 46 | 20 77 69 6e 64 6f 77 20 |EGIN..IF| window |
|00004c70| 3c 3e 20 4e 49 4c 20 54 | 48 45 4e 20 42 45 47 49 |<> NIL T|HEN BEGI|
|00004c80| 4e 09 7b 69 66 20 77 65 | 20 61 72 65 20 70 61 73 |N.{if we| are pas|
|00004c90| 73 65 64 20 61 20 77 69 | 6e 64 6f 77 2c 20 63 6c |sed a wi|ndow, cl|
|00004ca0| 6f 73 65 20 6f 74 68 65 | 72 20 77 69 6e 64 6f 77 |ose othe|r window|
|00004cb0| 73 20 62 65 68 69 6e 64 | 20 69 74 20 66 69 72 73 |s behind| it firs|
|00004cc0| 74 7d 0d 09 09 44 6f 43 | 6c 6f 73 65 42 65 68 69 |t}...DoC|loseBehi|
|00004cd0| 6e 64 28 57 69 6e 64 6f | 77 50 74 72 28 57 69 6e |nd(Windo|wPtr(Win|
|00004ce0| 64 6f 77 50 65 65 6b 28 | 77 69 6e 64 6f 77 29 5e |dowPeek(|window)^|
|00004cf0| 2e 6e 65 78 74 57 69 6e | 64 6f 77 29 29 3b 0d 09 |.nextWin|dow));..|
|00004d00| 09 44 6f 43 6c 6f 73 65 | 57 69 6e 64 6f 77 28 77 |.DoClose|Window(w|
|00004d10| 69 6e 64 6f 77 29 3b 09 | 7b 6e 6f 77 20 74 68 61 |indow);.|{now tha|
|00004d20| 74 20 61 6c 6c 20 74 68 | 65 20 77 69 6e 64 6f 77 |t all th|e window|
|00004d30| 73 20 62 65 68 69 6e 64 | 20 61 72 65 20 63 6c 6f |s behind| are clo|
|00004d40| 73 65 64 2c 20 63 6c 6f | 73 65 20 74 68 69 73 20 |sed, clo|se this |
|00004d50| 6f 6e 65 7d 0d 09 45 4e | 44 3b 0d 45 4e 44 3b 20 |one}..EN|D;.END; |
|00004d60| 7b 44 6f 43 6c 6f 73 65 | 42 65 68 69 6e 64 7d 0d |{DoClose|Behind}.|
|00004d70| 0d 0d 7b 24 53 20 4d 61 | 69 6e 7d 0d 50 52 4f 43 |..{$S Ma|in}.PROC|
|00004d80| 45 44 55 52 45 20 54 65 | 72 6d 69 6e 61 74 65 3b |EDURE Te|rminate;|
|00004d90| 0d 0d 7b 43 6c 65 61 6e | 20 75 70 20 74 68 65 20 |..{Clean| up the |
|00004da0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 61 6e 64 20 |applicat|ion and |
|00004db0| 65 78 69 74 73 2e 20 57 | 65 20 63 6c 6f 73 65 20 |exits. W|e close |
|00004dc0| 61 6c 6c 20 6f 66 20 74 | 68 65 20 77 69 6e 64 6f |all of t|he windo|
|00004dd0| 77 73 20 73 6f 20 74 68 | 61 74 0d 20 74 68 65 79 |ws so th|at. they|
|00004de0| 20 63 61 6e 20 75 70 64 | 61 74 65 20 74 68 65 69 | can upd|ate thei|
|00004df0| 72 20 64 6f 63 75 6d 65 | 6e 74 73 2e 7d 0d 0d 42 |r docume|nts.}..B|
|00004e00| 45 47 49 4e 0d 09 44 6f | 43 6c 6f 73 65 42 65 68 |EGIN..Do|CloseBeh|
|00004e10| 69 6e 64 28 46 72 6f 6e | 74 57 69 6e 64 6f 77 29 |ind(Fron|tWindow)|
|00004e20| 3b 09 7b 63 6c 6f 73 65 | 20 61 6c 6c 20 77 69 6e |;.{close| all win|
|00004e30| 64 6f 77 73 7d 0d 09 45 | 78 69 74 54 6f 53 68 65 |dows}..E|xitToShe|
|00004e40| 6c 6c 3b 0d 45 4e 44 3b | 20 7b 54 65 72 6d 69 6e |ll;.END;| {Termin|
|00004e50| 61 74 65 7d 0d 0d 0d 7b | 24 53 20 4d 61 69 6e 7d |ate}...{|$S Main}|
|00004e60| 0d 50 52 4f 43 45 44 55 | 52 45 20 41 64 6a 75 73 |.PROCEDU|RE Adjus|
|00004e70| 74 4d 65 6e 75 73 3b 0d | 0d 7b 45 6e 61 62 6c 65 |tMenus;.|.{Enable|
|00004e80| 20 61 6e 64 20 64 69 73 | 61 62 6c 65 20 6d 65 6e | and dis|able men|
|00004e90| 75 73 20 62 61 73 65 64 | 20 6f 6e 20 74 68 65 20 |us based| on the |
|00004ea0| 63 75 72 72 65 6e 74 20 | 73 74 61 74 65 2e 0d 20 |current |state.. |
|00004eb0| 54 68 65 20 75 73 65 72 | 20 63 61 6e 20 6f 6e 6c |The user| can onl|
|00004ec0| 79 20 73 65 6c 65 63 74 | 20 65 6e 61 62 6c 65 64 |y select| enabled|
|00004ed0| 20 6d 65 6e 75 20 69 74 | 65 6d 73 2e 20 57 65 20 | menu it|ems. We |
|00004ee0| 73 65 74 20 75 70 20 61 | 6c 6c 20 74 68 65 20 6d |set up a|ll the m|
|00004ef0| 65 6e 75 20 69 74 65 6d | 73 0d 20 62 65 66 6f 72 |enu item|s. befor|
|00004f00| 65 20 63 61 6c 6c 69 6e | 67 20 4d 65 6e 75 53 65 |e callin|g MenuSe|
|00004f10| 6c 65 63 74 20 6f 72 20 | 4d 65 6e 75 4b 65 79 2c |lect or |MenuKey,|
|00004f20| 20 73 69 6e 63 65 20 74 | 68 65 73 65 20 61 72 65 | since t|hese are|
|00004f30| 20 74 68 65 20 6f 6e 6c | 79 20 74 69 6d 65 73 20 | the onl|y times |
|00004f40| 74 68 61 74 0d 20 61 20 | 6d 65 6e 75 20 69 74 65 |that. a |menu ite|
|00004f50| 6d 20 63 61 6e 20 62 65 | 20 73 65 6c 65 63 74 65 |m can be| selecte|
|00004f60| 64 2e 20 4e 6f 74 65 20 | 74 68 61 74 20 4d 65 6e |d. Note |that Men|
|00004f70| 75 53 65 6c 65 63 74 20 | 69 73 20 61 6c 73 6f 20 |uSelect |is also |
|00004f80| 74 68 65 20 6f 6e 6c 79 | 20 74 69 6d 65 0d 20 74 |the only| time. t|
|00004f90| 68 65 20 75 73 65 72 20 | 77 69 6c 6c 20 73 65 65 |he user |will see|
|00004fa0| 20 6d 65 6e 75 20 69 74 | 65 6d 73 2e 7d 0d 0d 56 | menu it|ems.}..V|
|00004fb0| 41 52 0d 09 77 69 6e 64 | 6f 77 09 09 09 3a 20 57 |AR..wind|ow...: W|
|00004fc0| 69 6e 64 6f 77 50 74 72 | 3b 0d 09 6d 65 6e 75 09 |indowPtr|;..menu.|
|00004fd0| 09 09 3a 20 4d 65 6e 75 | 48 61 6e 64 6c 65 3b 0d |..: Menu|Handle;.|
|00004fe0| 09 6f 66 66 73 65 74 09 | 09 09 3a 20 4c 4f 4e 47 |.offset.|..: LONG|
|00004ff0| 49 4e 54 3b 0d 09 75 6e | 64 6f 09 09 09 3a 20 42 |INT;..un|do...: B|
|00005000| 4f 4f 4c 45 41 4e 3b 0d | 09 63 75 74 43 6f 70 79 |OOLEAN;.|.cutCopy|
|00005010| 43 6c 65 61 72 09 3a 20 | 42 4f 4f 4c 45 41 4e 3b |Clear.: |BOOLEAN;|
|00005020| 0d 09 70 61 73 74 65 09 | 09 09 3a 20 42 4f 4f 4c |..paste.|..: BOOL|
|00005030| 45 41 4e 3b 0d 0d 42 45 | 47 49 4e 0d 09 77 69 6e |EAN;..BE|GIN..win|
|00005040| 64 6f 77 20 3a 3d 20 46 | 72 6f 6e 74 57 69 6e 64 |dow := F|rontWind|
|00005050| 6f 77 3b 0d 0d 09 6d 65 | 6e 75 20 3a 3d 20 47 65 |ow;...me|nu := Ge|
|00005060| 74 4d 48 61 6e 64 6c 65 | 28 6d 46 69 6c 65 29 3b |tMHandle|(mFile);|
|00005070| 0d 09 49 46 20 67 4e 75 | 6d 44 6f 63 75 6d 65 6e |..IF gNu|mDocumen|
|00005080| 74 73 20 3c 20 6d 61 78 | 4f 70 65 6e 44 6f 63 75 |ts < max|OpenDocu|
|00005090| 6d 65 6e 74 73 20 54 48 | 45 4e 0d 09 09 45 6e 61 |ments TH|EN...Ena|
|000050a0| 62 6c 65 49 74 65 6d 28 | 6d 65 6e 75 2c 20 69 4e |bleItem(|menu, iN|
|000050b0| 65 77 29 09 09 7b 4e 65 | 77 20 69 73 20 65 6e 61 |ew)..{Ne|w is ena|
|000050c0| 62 6c 65 64 20 77 68 65 | 6e 20 77 65 20 63 61 6e |bled whe|n we can|
|000050d0| 20 6f 70 65 6e 20 6d 6f | 72 65 20 64 6f 63 75 6d | open mo|re docum|
|000050e0| 65 6e 74 73 7d 0d 09 45 | 4c 53 45 0d 09 09 44 69 |ents}..E|LSE...Di|
|000050f0| 73 61 62 6c 65 49 74 65 | 6d 28 6d 65 6e 75 2c 20 |sableIte|m(menu, |
|00005100| 69 4e 65 77 29 3b 0d 09 | 49 46 20 77 69 6e 64 6f |iNew);..|IF windo|
|00005110| 77 20 3c 3e 20 4e 49 4c | 20 54 48 45 4e 09 09 09 |w <> NIL| THEN...|
|00005120| 7b 43 6c 6f 73 65 20 69 | 73 20 65 6e 61 62 6c 65 |{Close i|s enable|
|00005130| 64 20 77 68 65 6e 20 74 | 68 65 72 65 20 69 73 20 |d when t|here is |
|00005140| 61 20 77 69 6e 64 6f 77 | 20 74 6f 20 63 6c 6f 73 |a window| to clos|
|00005150| 65 7d 0d 09 09 45 6e 61 | 62 6c 65 49 74 65 6d 28 |e}...Ena|bleItem(|
|00005160| 6d 65 6e 75 2c 20 69 43 | 6c 6f 73 65 29 0d 09 45 |menu, iC|lose)..E|
|00005170| 4c 53 45 0d 09 09 44 69 | 73 61 62 6c 65 49 74 65 |LSE...Di|sableIte|
|00005180| 6d 28 6d 65 6e 75 2c 20 | 69 43 6c 6f 73 65 29 3b |m(menu, |iClose);|
|00005190| 0d 0d 09 6d 65 6e 75 20 | 3a 3d 20 47 65 74 4d 48 |...menu |:= GetMH|
|000051a0| 61 6e 64 6c 65 28 6d 45 | 64 69 74 29 3b 0d 09 75 |andle(mE|dit);..u|
|000051b0| 6e 64 6f 20 3a 3d 20 46 | 41 4c 53 45 3b 0d 09 63 |ndo := F|ALSE;..c|
|000051c0| 75 74 43 6f 70 79 43 6c | 65 61 72 20 3a 3d 20 46 |utCopyCl|ear := F|
|000051d0| 41 4c 53 45 3b 0d 09 70 | 61 73 74 65 20 3a 3d 20 |ALSE;..p|aste := |
|000051e0| 46 41 4c 53 45 3b 0d 09 | 49 46 20 49 73 44 41 57 |FALSE;..|IF IsDAW|
|000051f0| 69 6e 64 6f 77 28 77 69 | 6e 64 6f 77 29 20 54 48 |indow(wi|ndow) TH|
|00005200| 45 4e 20 42 45 47 49 4e | 0d 09 09 75 6e 64 6f 20 |EN BEGIN|...undo |
|00005210| 3a 3d 20 54 52 55 45 3b | 09 09 09 09 7b 61 6c 6c |:= TRUE;|....{all|
|00005220| 20 65 64 69 74 69 6e 67 | 20 69 73 20 65 6e 61 62 | editing| is enab|
|00005230| 6c 65 64 20 66 6f 72 20 | 44 41 20 77 69 6e 64 6f |led for |DA windo|
|00005240| 77 73 7d 0d 09 09 63 75 | 74 43 6f 70 79 43 6c 65 |ws}...cu|tCopyCle|
|00005250| 61 72 20 3a 3d 20 54 52 | 55 45 3b 0d 09 09 70 61 |ar := TR|UE;...pa|
|00005260| 73 74 65 20 3a 3d 20 54 | 52 55 45 3b 0d 09 45 4e |ste := T|RUE;..EN|
|00005270| 44 20 45 4c 53 45 20 49 | 46 20 49 73 41 70 70 57 |D ELSE I|F IsAppW|
|00005280| 69 6e 64 6f 77 28 77 69 | 6e 64 6f 77 29 20 54 48 |indow(wi|ndow) TH|
|00005290| 45 4e 20 42 45 47 49 4e | 0d 09 09 57 49 54 48 20 |EN BEGIN|...WITH |
|000052a0| 44 6f 63 75 6d 65 6e 74 | 50 65 65 6b 28 77 69 6e |Document|Peek(win|
|000052b0| 64 6f 77 29 5e 2e 64 6f | 63 54 45 5e 5e 20 44 4f |dow)^.do|cTE^^ DO|
|000052c0| 0d 09 09 09 49 46 20 73 | 65 6c 53 74 61 72 74 20 |....IF s|elStart |
|000052d0| 3c 20 73 65 6c 45 6e 64 | 20 54 48 45 4e 0d 09 09 |< selEnd| THEN...|
|000052e0| 09 09 63 75 74 43 6f 70 | 79 43 6c 65 61 72 20 3a |..cutCop|yClear :|
|000052f0| 3d 20 54 52 55 45 3b 0d | 09 09 09 09 7b 43 75 74 |= TRUE;.|....{Cut|
|00005300| 2c 20 43 6f 70 79 2c 20 | 61 6e 64 20 43 6c 65 61 |, Copy, |and Clea|
|00005310| 72 20 69 73 20 65 6e 61 | 62 6c 65 64 20 66 6f 72 |r is ena|bled for|
|00005320| 20 61 70 70 2e 20 77 69 | 6e 64 6f 77 73 20 77 69 | app. wi|ndows wi|
|00005330| 74 68 20 73 65 6c 65 63 | 74 69 6f 6e 73 7d 0d 09 |th selec|tions}..|
|00005340| 09 49 46 20 47 65 74 53 | 63 72 61 70 28 4e 49 4c |.IF GetS|crap(NIL|
|00005350| 2c 20 27 54 45 58 54 27 | 2c 20 6f 66 66 73 65 74 |, 'TEXT'|, offset|
|00005360| 29 20 3e 20 30 20 54 48 | 45 4e 0d 09 09 09 70 61 |) > 0 TH|EN....pa|
|00005370| 73 74 65 20 3a 3d 20 54 | 52 55 45 3b 09 09 09 7b |ste := T|RUE;...{|
|00005380| 50 61 73 74 65 20 69 73 | 20 65 6e 61 62 6c 65 64 |Paste is| enabled|
|00005390| 20 66 6f 72 20 61 70 70 | 2e 20 77 69 6e 64 6f 77 | for app|. window|
|000053a0| 73 7d 0d 09 45 4e 44 3b | 0d 09 49 46 20 75 6e 64 |s}..END;|..IF und|
|000053b0| 6f 20 54 48 45 4e 0d 09 | 09 45 6e 61 62 6c 65 49 |o THEN..|.EnableI|
|000053c0| 74 65 6d 28 6d 65 6e 75 | 2c 20 69 55 6e 64 6f 29 |tem(menu|, iUndo)|
|000053d0| 0d 09 45 4c 53 45 0d 09 | 09 44 69 73 61 62 6c 65 |..ELSE..|.Disable|
|000053e0| 49 74 65 6d 28 6d 65 6e | 75 2c 20 69 55 6e 64 6f |Item(men|u, iUndo|
|000053f0| 29 3b 0d 09 49 46 20 63 | 75 74 43 6f 70 79 43 6c |);..IF c|utCopyCl|
|00005400| 65 61 72 20 54 48 45 4e | 20 42 45 47 49 4e 0d 09 |ear THEN| BEGIN..|
|00005410| 09 45 6e 61 62 6c 65 49 | 74 65 6d 28 6d 65 6e 75 |.EnableI|tem(menu|
|00005420| 2c 20 69 43 75 74 29 3b | 0d 09 09 45 6e 61 62 6c |, iCut);|...Enabl|
|00005430| 65 49 74 65 6d 28 6d 65 | 6e 75 2c 20 69 43 6f 70 |eItem(me|nu, iCop|
|00005440| 79 29 3b 0d 09 09 45 6e | 61 62 6c 65 49 74 65 6d |y);...En|ableItem|
|00005450| 28 6d 65 6e 75 2c 20 69 | 43 6c 65 61 72 29 3b 0d |(menu, i|Clear);.|
|00005460| 09 45 4e 44 20 45 4c 53 | 45 20 42 45 47 49 4e 0d |.END ELS|E BEGIN.|
|00005470| 09 09 44 69 73 61 62 6c | 65 49 74 65 6d 28 6d 65 |..Disabl|eItem(me|
|00005480| 6e 75 2c 20 69 43 75 74 | 29 3b 0d 09 09 44 69 73 |nu, iCut|);...Dis|
|00005490| 61 62 6c 65 49 74 65 6d | 28 6d 65 6e 75 2c 20 69 |ableItem|(menu, i|
|000054a0| 43 6f 70 79 29 3b 0d 09 | 09 44 69 73 61 62 6c 65 |Copy);..|.Disable|
|000054b0| 49 74 65 6d 28 6d 65 6e | 75 2c 20 69 43 6c 65 61 |Item(men|u, iClea|
|000054c0| 72 29 3b 0d 09 45 4e 44 | 3b 0d 09 49 46 20 70 61 |r);..END|;..IF pa|
|000054d0| 73 74 65 20 54 48 45 4e | 0d 09 09 45 6e 61 62 6c |ste THEN|...Enabl|
|000054e0| 65 49 74 65 6d 28 6d 65 | 6e 75 2c 20 69 50 61 73 |eItem(me|nu, iPas|
|000054f0| 74 65 29 0d 09 45 4c 53 | 45 0d 09 09 44 69 73 61 |te)..ELS|E...Disa|
|00005500| 62 6c 65 49 74 65 6d 28 | 6d 65 6e 75 2c 20 69 50 |bleItem(|menu, iP|
|00005510| 61 73 74 65 29 3b 0d 45 | 4e 44 3b 20 7b 41 64 6a |aste);.E|ND; {Adj|
|00005520| 75 73 74 4d 65 6e 75 73 | 7d 0d 0d 0d 7b 24 53 20 |ustMenus|}...{$S |
|00005530| 4d 61 69 6e 7d 0d 50 52 | 4f 43 45 44 55 52 45 20 |Main}.PR|OCEDURE |
|00005540| 44 6f 4d 65 6e 75 43 6f | 6d 6d 61 6e 64 28 6d 65 |DoMenuCo|mmand(me|
|00005550| 6e 75 52 65 73 75 6c 74 | 3a 20 4c 4f 4e 47 49 4e |nuResult|: LONGIN|
|00005560| 54 29 3b 0d 0d 7b 54 68 | 69 73 20 69 73 20 63 61 |T);..{Th|is is ca|
|00005570| 6c 6c 65 64 20 77 68 65 | 6e 20 61 6e 20 69 74 65 |lled whe|n an ite|
|00005580| 6d 20 69 73 20 63 68 6f | 73 65 6e 20 66 72 6f 6d |m is cho|sen from|
|00005590| 20 74 68 65 20 6d 65 6e | 75 20 62 61 72 20 28 61 | the men|u bar (a|
|000055a0| 66 74 65 72 20 63 61 6c | 6c 69 6e 67 0d 20 4d 65 |fter cal|ling. Me|
|000055b0| 6e 75 53 65 6c 65 63 74 | 20 6f 72 20 4d 65 6e 75 |nuSelect| or Menu|
|000055c0| 4b 65 79 29 2e 20 49 74 | 20 64 6f 65 73 20 74 68 |Key). It| does th|
|000055d0| 65 20 72 69 67 68 74 20 | 74 68 69 6e 67 20 66 6f |e right |thing fo|
|000055e0| 72 20 65 61 63 68 20 63 | 6f 6d 6d 61 6e 64 2e 7d |r each c|ommand.}|
|000055f0| 0d 0d 56 41 52 0d 09 6d | 65 6e 75 49 44 09 09 09 |..VAR..m|enuID...|
|00005600| 3a 20 49 4e 54 45 47 45 | 52 3b 0d 09 6d 65 6e 75 |: INTEGE|R;..menu|
|00005610| 49 74 65 6d 09 09 3a 20 | 49 4e 54 45 47 45 52 3b |Item..: |INTEGER;|
|00005620| 0d 09 69 74 65 6d 48 69 | 74 09 09 09 3a 20 49 4e |..itemHi|t...: IN|
|00005630| 54 45 47 45 52 3b 0d 09 | 64 61 4e 61 6d 65 09 09 |TEGER;..|daName..|
|00005640| 09 3a 20 53 74 72 32 35 | 35 3b 0d 09 64 61 52 65 |.: Str25|5;..daRe|
|00005650| 66 4e 75 6d 09 09 3a 20 | 49 4e 54 45 47 45 52 3b |fNum..: |INTEGER;|
|00005660| 0d 09 69 67 6e 6f 72 65 | 52 65 73 75 6c 74 09 3a |..ignore|Result.:|
|00005670| 20 4f 53 45 72 72 3b 0d | 09 68 61 6e 64 6c 65 64 | OSErr;.|.handled|
|00005680| 42 79 44 41 09 09 3a 20 | 42 4f 4f 4c 45 41 4e 3b |ByDA..: |BOOLEAN;|
|00005690| 0d 09 74 65 09 09 09 09 | 3a 20 54 45 48 61 6e 64 |..te....|: TEHand|
|000056a0| 6c 65 3b 0d 09 77 69 6e | 64 6f 77 09 09 09 3a 20 |le;..win|dow...: |
|000056b0| 57 69 6e 64 6f 77 50 74 | 72 3b 0d 0d 42 45 47 49 |WindowPt|r;..BEGI|
|000056c0| 4e 0d 09 77 69 6e 64 6f | 77 20 3a 3d 20 46 72 6f |N..windo|w := Fro|
|000056d0| 6e 74 57 69 6e 64 6f 77 | 3b 0d 09 6d 65 6e 75 49 |ntWindow|;..menuI|
|000056e0| 44 20 3a 3d 20 48 69 57 | 72 64 28 6d 65 6e 75 52 |D := HiW|rd(menuR|
|000056f0| 65 73 75 6c 74 29 3b 09 | 7b 75 73 65 20 62 75 69 |esult);.|{use bui|
|00005700| 6c 74 2d 69 6e 73 20 28 | 66 6f 72 20 65 66 66 69 |lt-ins (|for effi|
|00005710| 63 69 65 6e 63 79 29 2e | 2e 2e 7d 0d 09 6d 65 6e |ciency).|..}..men|
|00005720| 75 49 74 65 6d 20 3a 3d | 20 4c 6f 57 72 64 28 6d |uItem :=| LoWrd(m|
|00005730| 65 6e 75 52 65 73 75 6c | 74 29 3b 09 7b 74 6f 20 |enuResul|t);.{to |
|00005740| 67 65 74 20 6d 65 6e 75 | 20 69 74 65 6d 20 6e 75 |get menu| item nu|
|00005750| 6d 62 65 72 20 61 6e 64 | 20 6d 65 6e 75 20 6e 75 |mber and| menu nu|
|00005760| 6d 62 65 72 7d 0d 09 43 | 41 53 45 20 6d 65 6e 75 |mber}..C|ASE menu|
|00005770| 49 44 20 4f 46 0d 09 09 | 6d 41 70 70 6c 65 3a 0d |ID OF...|mApple:.|
|00005780| 09 09 09 43 41 53 45 20 | 6d 65 6e 75 49 74 65 6d |...CASE |menuItem|
|00005790| 20 4f 46 0d 09 09 09 09 | 69 41 62 6f 75 74 3a 09 | OF.....|iAbout:.|
|000057a0| 09 09 09 7b 62 72 69 6e | 67 20 75 70 20 61 6c 65 |...{brin|g up ale|
|000057b0| 72 74 20 66 6f 72 20 41 | 62 6f 75 74 7d 0d 09 09 |rt for A|bout}...|
|000057c0| 09 09 09 69 74 65 6d 48 | 69 74 20 3a 3d 20 41 6c |...itemH|it := Al|
|000057d0| 65 72 74 28 72 41 62 6f | 75 74 41 6c 65 72 74 2c |ert(rAbo|utAlert,|
|000057e0| 20 4e 49 4c 29 3b 0d 09 | 09 09 09 4f 54 48 45 52 | NIL);..|...OTHER|
|000057f0| 57 49 53 45 20 42 45 47 | 49 4e 09 09 7b 61 6c 6c |WISE BEG|IN..{all|
|00005800| 20 6e 6f 6e 2d 41 62 6f | 75 74 20 69 74 65 6d 73 | non-Abo|ut items|
|00005810| 20 69 6e 20 74 68 69 73 | 20 6d 65 6e 75 20 61 72 | in this| menu ar|
|00005820| 65 20 44 41 73 7d 0d 09 | 09 09 09 09 47 65 74 49 |e DAs}..|....GetI|
|00005830| 74 65 6d 28 47 65 74 4d | 48 61 6e 64 6c 65 28 6d |tem(GetM|Handle(m|
|00005840| 41 70 70 6c 65 29 2c 20 | 6d 65 6e 75 49 74 65 6d |Apple), |menuItem|
|00005850| 2c 20 64 61 4e 61 6d 65 | 29 3b 0d 09 09 09 09 09 |, daName|);......|
|00005860| 64 61 52 65 66 4e 75 6d | 20 3a 3d 20 4f 70 65 6e |daRefNum| := Open|
|00005870| 44 65 73 6b 41 63 63 28 | 64 61 4e 61 6d 65 29 3b |DeskAcc(|daName);|
|00005880| 0d 09 09 09 09 45 4e 44 | 3b 0d 09 09 09 45 4e 44 |.....END|;....END|
|00005890| 3b 0d 09 09 6d 46 69 6c | 65 3a 0d 09 09 09 43 41 |;...mFil|e:....CA|
|000058a0| 53 45 20 6d 65 6e 75 49 | 74 65 6d 20 4f 46 0d 09 |SE menuI|tem OF..|
|000058b0| 09 09 09 69 4e 65 77 3a | 0d 09 09 09 09 09 44 6f |...iNew:|......Do|
|000058c0| 4e 65 77 3b 0d 09 09 09 | 09 69 43 6c 6f 73 65 3a |New;....|.iClose:|
|000058d0| 0d 09 09 09 09 09 44 6f | 43 6c 6f 73 65 57 69 6e |......Do|CloseWin|
|000058e0| 64 6f 77 28 77 69 6e 64 | 6f 77 29 3b 0d 09 09 09 |dow(wind|ow);....|
|000058f0| 09 69 51 75 69 74 3a 0d | 09 09 09 09 09 54 65 72 |.iQuit:.|.....Ter|
|00005900| 6d 69 6e 61 74 65 3b 0d | 09 09 09 45 4e 44 3b 0d |minate;.|...END;.|
|00005910| 09 09 6d 45 64 69 74 3a | 20 42 45 47 49 4e 09 09 |..mEdit:| BEGIN..|
|00005920| 09 09 7b 63 61 6c 6c 20 | 53 79 73 74 65 6d 45 64 |..{call |SystemEd|
|00005930| 69 74 20 66 6f 72 20 44 | 41 20 65 64 69 74 69 6e |it for D|A editin|
|00005940| 67 20 26 20 4d 75 6c 74 | 69 46 69 6e 64 65 72 7d |g & Mult|iFinder}|
|00005950| 0d 09 09 09 49 46 20 4e | 4f 54 20 53 79 73 74 65 |....IF N|OT Syste|
|00005960| 6d 45 64 69 74 28 6d 65 | 6e 75 49 74 65 6d 2d 31 |mEdit(me|nuItem-1|
|00005970| 29 20 54 48 45 4e 20 42 | 45 47 49 4e 0d 09 09 09 |) THEN B|EGIN....|
|00005980| 09 74 65 20 3a 3d 20 44 | 6f 63 75 6d 65 6e 74 50 |.te := D|ocumentP|
|00005990| 65 65 6b 28 77 69 6e 64 | 6f 77 29 5e 2e 64 6f 63 |eek(wind|ow)^.doc|
|000059a0| 54 45 3b 0d 09 09 09 09 | 43 41 53 45 20 6d 65 6e |TE;.....|CASE men|
|000059b0| 75 49 74 65 6d 20 4f 46 | 0d 09 09 09 09 09 69 43 |uItem OF|......iC|
|000059c0| 75 74 3a 20 42 45 47 49 | 4e 09 09 7b 61 66 74 65 |ut: BEGI|N..{afte|
|000059d0| 72 20 63 75 74 74 69 6e | 67 2c 20 65 78 70 6f 72 |r cuttin|g, expor|
|000059e0| 74 20 74 68 65 20 54 45 | 20 73 63 72 61 70 7d 0d |t the TE| scrap}.|
|000059f0| 09 09 09 09 09 09 49 46 | 20 5a 65 72 6f 53 63 72 |......IF| ZeroScr|
|00005a00| 61 70 20 3d 20 6e 6f 45 | 72 72 20 54 48 45 4e 20 |ap = noE|rr THEN |
|00005a10| 42 45 47 49 4e 0d 09 09 | 09 09 09 09 09 54 45 43 |BEGIN...|.....TEC|
|00005a20| 75 74 28 74 65 29 3b 0d | 09 09 09 09 09 09 09 49 |ut(te);.|.......I|
|00005a30| 46 20 54 45 54 6f 53 63 | 72 61 70 20 3c 3e 20 6e |F TEToSc|rap <> n|
|00005a40| 6f 45 72 72 20 54 48 45 | 4e 20 42 45 47 49 4e 0d |oErr THE|N BEGIN.|
|00005a50| 09 09 09 09 09 09 09 09 | 53 65 74 43 75 72 73 6f |........|SetCurso|
|00005a60| 72 28 61 72 72 6f 77 29 | 3b 0d 09 09 09 09 09 09 |r(arrow)|;.......|
|00005a70| 09 09 69 74 65 6d 48 69 | 74 20 3a 3d 20 41 6c 65 |..itemHi|t := Ale|
|00005a80| 72 74 28 72 45 64 69 74 | 41 6c 65 72 74 2c 20 4e |rt(rEdit|Alert, N|
|00005a90| 49 4c 29 3b 0d 09 09 09 | 09 09 09 09 09 69 67 6e |IL);....|.....ign|
|00005aa0| 6f 72 65 52 65 73 75 6c | 74 20 3a 3d 20 5a 65 72 |oreResul|t := Zer|
|00005ab0| 6f 53 63 72 61 70 3b 0d | 09 09 09 09 09 09 09 45 |oScrap;.|.......E|
|00005ac0| 4e 44 3b 0d 09 09 09 09 | 09 09 45 4e 44 3b 0d 09 |ND;.....|..END;..|
|00005ad0| 09 09 09 09 45 4e 44 3b | 0d 09 09 09 09 09 69 43 |....END;|......iC|
|00005ae0| 6f 70 79 3a 20 42 45 47 | 49 4e 09 7b 61 66 74 65 |opy: BEG|IN.{afte|
|00005af0| 72 20 63 6f 70 79 69 6e | 67 2c 20 65 78 70 6f 72 |r copyin|g, expor|
|00005b00| 74 20 74 68 65 20 54 45 | 20 73 63 72 61 70 7d 0d |t the TE| scrap}.|
|00005b10| 09 09 09 09 09 09 49 46 | 20 5a 65 72 6f 53 63 72 |......IF| ZeroScr|
|00005b20| 61 70 20 3d 20 6e 6f 45 | 72 72 20 54 48 45 4e 20 |ap = noE|rr THEN |
|00005b30| 42 45 47 49 4e 0d 09 09 | 09 09 09 09 09 54 45 43 |BEGIN...|.....TEC|
|00005b40| 6f 70 79 28 74 65 29 3b | 0d 09 09 09 09 09 09 09 |opy(te);|........|
|00005b50| 49 46 20 54 45 54 6f 53 | 63 72 61 70 20 3c 3e 20 |IF TEToS|crap <> |
|00005b60| 6e 6f 45 72 72 20 54 48 | 45 4e 20 42 45 47 49 4e |noErr TH|EN BEGIN|
|00005b70| 0d 09 09 09 09 09 09 09 | 09 53 65 74 43 75 72 73 |........|.SetCurs|
|00005b80| 6f 72 28 61 72 72 6f 77 | 29 3b 0d 09 09 09 09 09 |or(arrow|);......|
|00005b90| 09 09 09 69 74 65 6d 48 | 69 74 20 3a 3d 20 41 6c |...itemH|it := Al|
|00005ba0| 65 72 74 28 72 45 64 69 | 74 41 6c 65 72 74 2c 20 |ert(rEdi|tAlert, |
|00005bb0| 4e 49 4c 29 3b 0d 09 09 | 09 09 09 09 09 09 69 67 |NIL);...|......ig|
|00005bc0| 6e 6f 72 65 52 65 73 75 | 6c 74 20 3a 3d 20 5a 65 |noreResu|lt := Ze|
|00005bd0| 72 6f 53 63 72 61 70 3b | 0d 09 09 09 09 09 09 09 |roScrap;|........|
|00005be0| 45 4e 44 3b 0d 09 09 09 | 09 09 09 45 4e 44 3b 0d |END;....|...END;.|
|00005bf0| 09 09 09 09 09 45 4e 44 | 3b 0d 09 09 09 09 09 69 |.....END|;......i|
|00005c00| 50 61 73 74 65 3a 20 42 | 45 47 49 4e 09 7b 69 6d |Paste: B|EGIN.{im|
|00005c10| 70 6f 72 74 20 74 68 65 | 20 54 45 20 73 63 72 61 |port the| TE scra|
|00005c20| 70 20 62 65 66 6f 72 65 | 20 70 61 73 74 69 6e 67 |p before| pasting|
|00005c30| 7d 0d 09 09 09 09 09 09 | 49 46 20 54 45 46 72 6f |}.......|IF TEFro|
|00005c40| 6d 53 63 72 61 70 20 3d | 20 6e 6f 45 72 72 20 54 |mScrap =| noErr T|
|00005c50| 48 45 4e 20 42 45 47 49 | 4e 0d 09 09 09 09 09 09 |HEN BEGI|N.......|
|00005c60| 09 49 46 20 54 45 47 65 | 74 53 63 72 61 70 4c 65 |.IF TEGe|tScrapLe|
|00005c70| 6e 20 2b 20 28 74 65 5e | 5e 2e 74 65 4c 65 6e 67 |n + (te^|^.teLeng|
|00005c80| 74 68 20 2d 0d 09 09 09 | 09 09 09 09 09 28 74 65 |th -....|.....(te|
|00005c90| 5e 5e 2e 73 65 6c 45 6e | 64 20 2d 20 74 65 5e 5e |^^.selEn|d - te^^|
|00005ca0| 2e 73 65 6c 53 74 61 72 | 74 29 29 20 3c 20 6d 61 |.selStar|t)) < ma|
|00005cb0| 78 54 45 4c 65 6e 67 74 | 68 20 54 48 45 4e 0d 09 |xTELengt|h THEN..|
|00005cc0| 09 09 09 09 09 09 09 54 | 45 50 61 73 74 65 28 74 |.......T|EPaste(t|
|00005cd0| 65 29 0d 09 09 09 09 09 | 09 09 45 4c 53 45 20 42 |e)......|..ELSE B|
|00005ce0| 45 47 49 4e 0d 09 09 09 | 09 09 09 09 09 53 65 74 |EGIN....|.....Set|
|00005cf0| 43 75 72 73 6f 72 28 61 | 72 72 6f 77 29 3b 0d 09 |Cursor(a|rrow);..|
|00005d00| 09 09 09 09 09 09 09 69 | 74 65 6d 48 69 74 20 3a |.......i|temHit :|
|00005d10| 3d 20 41 6c 65 72 74 28 | 72 45 64 69 74 41 6c 65 |= Alert(|rEditAle|
|00005d20| 72 74 2c 20 4e 49 4c 29 | 3b 0d 09 09 09 09 09 09 |rt, NIL)|;.......|
|00005d30| 09 45 4e 44 3b 0d 09 09 | 09 09 09 09 45 4e 44 3b |.END;...|....END;|
|00005d40| 0d 09 09 09 09 09 45 4e | 44 3b 0d 09 09 09 09 09 |......EN|D;......|
|00005d50| 69 43 6c 65 61 72 3a 0d | 09 09 09 09 09 09 54 45 |iClear:.|......TE|
|00005d60| 44 65 6c 65 74 65 28 74 | 65 29 3b 0d 09 09 09 09 |Delete(t|e);.....|
|00005d70| 45 4e 44 3b 0d 09 09 09 | 09 41 64 6a 75 73 74 53 |END;....|.AdjustS|
|00005d80| 63 72 6f 6c 6c 62 61 72 | 73 28 77 69 6e 64 6f 77 |crollbar|s(window|
|00005d90| 2c 20 46 41 4c 53 45 29 | 3b 0d 09 09 09 09 41 64 |, FALSE)|;.....Ad|
|00005da0| 6a 75 73 74 54 45 28 77 | 69 6e 64 6f 77 29 3b 0d |justTE(w|indow);.|
|00005db0| 09 09 09 45 4e 44 3b 0d | 09 09 45 4e 44 3b 0d 09 |...END;.|..END;..|
|00005dc0| 45 4e 44 3b 0d 09 48 69 | 6c 69 74 65 4d 65 6e 75 |END;..Hi|liteMenu|
|00005dd0| 28 30 29 3b 09 09 09 09 | 09 7b 75 6e 68 69 67 68 |(0);....|.{unhigh|
|00005de0| 6c 69 67 68 74 20 77 68 | 61 74 20 4d 65 6e 75 53 |light wh|at MenuS|
|00005df0| 65 6c 65 63 74 20 28 6f | 72 20 4d 65 6e 75 4b 65 |elect (o|r MenuKe|
|00005e00| 79 29 20 68 69 6c 69 74 | 65 64 7d 0d 45 4e 44 3b |y) hilit|ed}.END;|
|00005e10| 20 7b 44 6f 4d 65 6e 75 | 43 6f 6d 6d 61 6e 64 7d | {DoMenu|Command}|
|00005e20| 0d 0d 0d 7b 24 53 20 4d | 61 69 6e 7d 0d 50 52 4f |...{$S M|ain}.PRO|
|00005e30| 43 45 44 55 52 45 20 44 | 72 61 77 57 69 6e 64 6f |CEDURE D|rawWindo|
|00005e40| 77 28 77 69 6e 64 6f 77 | 3a 20 57 69 6e 64 6f 77 |w(window|: Window|
|00005e50| 50 74 72 29 3b 0d 0d 7b | 44 72 61 77 20 74 68 65 |Ptr);..{|Draw the|
|00005e60| 20 63 6f 6e 74 65 6e 74 | 73 20 6f 66 20 61 6e 20 | content|s of an |
|00005e70| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 77 69 6e 64 |applicat|ion wind|
|00005e80| 6f 77 2e 7d 0d 0d 42 45 | 47 49 4e 0d 09 53 65 74 |ow.}..BE|GIN..Set|
|00005e90| 50 6f 72 74 28 77 69 6e | 64 6f 77 29 3b 0d 09 57 |Port(win|dow);..W|
|00005ea0| 49 54 48 20 77 69 6e 64 | 6f 77 5e 20 44 4f 20 42 |ITH wind|ow^ DO B|
|00005eb0| 45 47 49 4e 0d 09 09 45 | 72 61 73 65 52 65 63 74 |EGIN...E|raseRect|
|00005ec0| 28 70 6f 72 74 52 65 63 | 74 29 3b 09 09 7b 61 73 |(portRec|t);..{as|
|00005ed0| 20 70 65 72 20 54 65 78 | 74 45 64 69 74 20 63 68 | per Tex|tEdit ch|
|00005ee0| 61 70 74 65 72 20 6f 66 | 20 49 6e 73 69 64 65 20 |apter of| Inside |
|00005ef0| 4d 61 63 69 6e 74 6f 73 | 68 7d 0d 09 09 44 72 61 |Macintos|h}...Dra|
|00005f00| 77 43 6f 6e 74 72 6f 6c | 73 28 77 69 6e 64 6f 77 |wControl|s(window|
|00005f10| 29 3b 09 09 7b 74 68 69 | 73 20 6f 72 64 65 72 69 |);..{thi|s orderi|
|00005f20| 6e 67 20 6d 61 6b 65 73 | 20 66 6f 72 20 61 20 62 |ng makes| for a b|
|00005f30| 65 74 74 65 72 20 61 70 | 70 65 61 72 61 6e 63 65 |etter ap|pearance|
|00005f40| 7d 0d 09 09 44 72 61 77 | 47 72 6f 77 49 63 6f 6e |}...Draw|GrowIcon|
|00005f50| 28 77 69 6e 64 6f 77 29 | 3b 0d 09 09 54 45 55 70 |(window)|;...TEUp|
|00005f60| 64 61 74 65 28 70 6f 72 | 74 52 65 63 74 2c 20 44 |date(por|tRect, D|
|00005f70| 6f 63 75 6d 65 6e 74 50 | 65 65 6b 28 77 69 6e 64 |ocumentP|eek(wind|
|00005f80| 6f 77 29 5e 2e 64 6f 63 | 54 45 29 3b 0d 09 45 4e |ow)^.doc|TE);..EN|
|00005f90| 44 3b 0d 45 4e 44 3b 20 | 7b 44 72 61 77 57 69 6e |D;.END; |{DrawWin|
|00005fa0| 64 6f 77 7d 0d 0d 0d 7b | 24 53 20 4d 61 69 6e 7d |dow}...{|$S Main}|
|00005fb0| 0d 46 55 4e 43 54 49 4f | 4e 20 47 65 74 53 6c 65 |.FUNCTIO|N GetSle|
|00005fc0| 65 70 3a 20 4c 4f 4e 47 | 49 4e 54 3b 0d 0d 7b 43 |ep: LONG|INT;..{C|
|00005fd0| 61 6c 63 75 6c 61 74 65 | 20 61 20 73 6c 65 65 70 |alculate| a sleep|
|00005fe0| 20 76 61 6c 75 65 20 66 | 6f 72 20 57 61 69 74 4e | value f|or WaitN|
|00005ff0| 65 78 74 45 76 65 6e 74 | 2e 20 54 68 69 73 20 74 |extEvent|. This t|
|00006000| 61 6b 65 73 20 69 6e 74 | 6f 20 61 63 63 6f 75 6e |akes int|o accoun|
|00006010| 74 20 74 68 65 20 74 68 | 69 6e 67 73 0d 20 74 68 |t the th|ings. th|
|00006020| 61 74 20 44 6f 49 64 6c | 65 20 64 6f 65 73 20 77 |at DoIdl|e does w|
|00006030| 69 74 68 20 69 64 6c 65 | 20 74 69 6d 65 2e 7d 0d |ith idle| time.}.|
|00006040| 0d 56 41 52 0d 09 73 6c | 65 65 70 09 3a 20 4c 4f |.VAR..sl|eep.: LO|
|00006050| 4e 47 49 4e 54 3b 0d 09 | 77 69 6e 64 6f 77 09 3a |NGINT;..|window.:|
|00006060| 20 57 69 6e 64 6f 77 50 | 74 72 3b 0d 0d 42 45 47 | WindowP|tr;..BEG|
|00006070| 49 4e 0d 09 73 6c 65 65 | 70 20 3a 3d 20 4d 41 58 |IN..slee|p := MAX|
|00006080| 4c 4f 4e 47 49 4e 54 3b | 09 09 09 09 09 7b 64 65 |LONGINT;|.....{de|
|00006090| 66 61 75 6c 74 20 76 61 | 6c 75 65 20 66 6f 72 20 |fault va|lue for |
|000060a0| 73 6c 65 65 70 7d 0d 09 | 49 46 20 4e 4f 54 20 67 |sleep}..|IF NOT g|
|000060b0| 49 6e 42 61 63 6b 67 72 | 6f 75 6e 64 20 54 48 45 |InBackgr|ound THE|
|000060c0| 4e 20 42 45 47 49 4e 09 | 09 09 7b 69 66 20 77 65 |N BEGIN.|..{if we|
|000060d0| 20 61 72 65 20 69 6e 20 | 66 72 6f 6e 74 2e 2e 2e | are in |front...|
|000060e0| 7d 0d 09 09 77 69 6e 64 | 6f 77 20 3a 3d 20 46 72 |}...wind|ow := Fr|
|000060f0| 6f 6e 74 57 69 6e 64 6f | 77 3b 09 09 09 7b 61 6e |ontWindo|w;...{an|
|00006100| 64 20 74 68 65 20 66 72 | 6f 6e 74 20 77 69 6e 64 |d the fr|ont wind|
|00006110| 6f 77 20 69 73 20 6f 75 | 72 73 2e 2e 2e 7d 0d 09 |ow is ou|rs...}..|
|00006120| 09 49 46 20 49 73 41 70 | 70 57 69 6e 64 6f 77 28 |.IF IsAp|pWindow(|
|00006130| 77 69 6e 64 6f 77 29 20 | 54 48 45 4e 20 42 45 47 |window) |THEN BEG|
|00006140| 49 4e 0d 09 09 09 57 49 | 54 48 20 44 6f 63 75 6d |IN....WI|TH Docum|
|00006150| 65 6e 74 50 65 65 6b 28 | 77 69 6e 64 6f 77 29 5e |entPeek(|window)^|
|00006160| 2e 64 6f 63 54 45 5e 5e | 20 44 4f 0d 09 09 09 09 |.docTE^^| DO.....|
|00006170| 49 46 20 73 65 6c 53 74 | 61 72 74 20 3d 20 73 65 |IF selSt|art = se|
|00006180| 6c 45 6e 64 20 54 48 45 | 4e 09 7b 61 6e 64 20 74 |lEnd THE|N.{and t|
|00006190| 68 65 20 73 65 6c 65 63 | 74 69 6f 6e 20 69 73 20 |he selec|tion is |
|000061a0| 61 6e 20 69 6e 73 65 72 | 74 69 6f 6e 20 70 6f 69 |an inser|tion poi|
|000061b0| 6e 74 2e 2e 2e 7d 0d 09 | 09 09 09 09 73 6c 65 65 |nt...}..|....slee|
|000061c0| 70 20 3a 3d 20 47 65 74 | 43 61 72 65 74 54 69 6d |p := Get|CaretTim|
|000061d0| 65 3b 09 7b 77 65 20 6e | 65 65 64 20 74 6f 20 62 |e;.{we n|eed to b|
|000061e0| 6c 69 6e 6b 20 74 68 65 | 20 69 6e 73 65 72 74 69 |link the| inserti|
|000061f0| 6f 6e 20 70 6f 69 6e 74 | 7d 0d 09 09 45 4e 44 3b |on point|}...END;|
|00006200| 0d 09 45 4e 44 3b 0d 09 | 47 65 74 53 6c 65 65 70 |..END;..|GetSleep|
|00006210| 20 3a 3d 20 73 6c 65 65 | 70 3b 0d 45 4e 44 3b 20 | := slee|p;.END; |
|00006220| 7b 47 65 74 53 6c 65 65 | 70 7d 0d 0d 0d 7b 24 53 |{GetSlee|p}...{$S|
|00006230| 20 4d 61 69 6e 7d 0d 50 | 52 4f 43 45 44 55 52 45 | Main}.P|ROCEDURE|
|00006240| 20 43 6f 6d 6d 6f 6e 41 | 63 74 69 6f 6e 28 63 6f | CommonA|ction(co|
|00006250| 6e 74 72 6f 6c 3a 20 43 | 6f 6e 74 72 6f 6c 48 61 |ntrol: C|ontrolHa|
|00006260| 6e 64 6c 65 3b 20 56 41 | 52 20 61 6d 6f 75 6e 74 |ndle; VA|R amount|
|00006270| 3a 20 49 4e 54 45 47 45 | 52 29 3b 0d 0d 7b 43 6f |: INTEGE|R);..{Co|
|00006280| 6d 6d 6f 6e 20 61 6c 67 | 6f 72 69 74 68 6d 20 66 |mmon alg|orithm f|
|00006290| 6f 72 20 73 65 74 74 69 | 6e 67 20 74 68 65 20 6e |or setti|ng the n|
|000062a0| 65 77 20 76 61 6c 75 65 | 20 6f 66 20 61 20 63 6f |ew value| of a co|
|000062b0| 6e 74 72 6f 6c 2e 20 49 | 74 20 72 65 74 75 72 6e |ntrol. I|t return|
|000062c0| 73 20 74 68 65 20 61 63 | 74 75 61 6c 20 61 6d 6f |s the ac|tual amo|
|000062d0| 75 6e 74 0d 74 68 65 20 | 76 61 6c 75 65 20 6f 66 |unt.the |value of|
|000062e0| 20 74 68 65 20 63 6f 6e | 74 72 6f 6c 20 63 68 61 | the con|trol cha|
|000062f0| 6e 67 65 64 2e 20 4e 6f | 74 65 20 74 68 65 20 70 |nged. No|te the p|
|00006300| 69 6e 6e 69 6e 67 20 69 | 73 20 64 6f 6e 65 20 66 |inning i|s done f|
|00006310| 6f 72 20 74 68 65 20 73 | 61 6b 65 20 6f 66 20 72 |or the s|ake of r|
|00006320| 65 74 75 72 6e 69 6e 67 | 0d 74 68 65 20 61 6d 6f |eturning|.the amo|
|00006330| 75 6e 74 20 74 68 65 20 | 63 6f 6e 74 72 6f 6c 20 |unt the |control |
|00006340| 76 61 6c 75 65 20 63 68 | 61 6e 67 65 64 2e 7d 0d |value ch|anged.}.|
|00006350| 0d 56 41 52 0d 09 76 61 | 6c 75 65 2c 20 6d 61 78 |.VAR..va|lue, max|
|00006360| 09 3a 20 49 4e 54 45 47 | 45 52 3b 0d 09 77 69 6e |.: INTEG|ER;..win|
|00006370| 64 6f 77 09 09 3a 20 57 | 69 6e 64 6f 77 50 74 72 |dow..: W|indowPtr|
|00006380| 3b 0d 42 45 47 49 4e 0d | 09 76 61 6c 75 65 20 3a |;.BEGIN.|.value :|
|00006390| 3d 20 47 65 74 43 74 6c | 56 61 6c 75 65 28 63 6f |= GetCtl|Value(co|
|000063a0| 6e 74 72 6f 6c 29 3b 09 | 7b 67 65 74 20 63 75 72 |ntrol);.|{get cur|
|000063b0| 72 65 6e 74 20 76 61 6c | 75 65 7d 0d 09 6d 61 78 |rent val|ue}..max|
|000063c0| 20 3a 3d 20 47 65 74 43 | 74 6c 4d 61 78 28 63 6f | := GetC|tlMax(co|
|000063d0| 6e 74 72 6f 6c 29 3b 09 | 09 7b 61 6e 64 20 6d 61 |ntrol);.|.{and ma|
|000063e0| 78 20 76 61 6c 75 65 7d | 0d 09 61 6d 6f 75 6e 74 |x value}|..amount|
|000063f0| 20 3a 3d 20 76 61 6c 75 | 65 20 2d 20 61 6d 6f 75 | := valu|e - amou|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.